Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 underscore.js 如何提醒数组中的每个项目?这甚至可能吗?我尝试使用调用函数,但它不起作用。你能帮忙吗?
_.invoke([1,3,7],alert(this));
调用不是此任务的正确方法。尝试每个:
_.each([1,3,7], alert);
或者您可以alert显式调用:
alert
_.each([1,3,7], function(el) { alert(el); });