如何使用对象“_”在下划线.js 中
我是nodejs新手,我能想到的唯一方法是:
var a = require ('./undercore-min')
并使用下划线对象
a([1,2,3]).each(function(a){console.log a})
,但我喜欢使用优雅的“_”语法,
_([1,2,3]).each()
如何做到这一点,以及如何在全局范围内使用下划线?
I'm new to nodejs, the only way that I can come up with is :
var a = require ('./undercore-min')
and make use of underscore object
a([1,2,3]).each(function(a){console.log a})
but I'd love to use the elegant '_' syntax,
_([1,2,3]).each()
how to do that, and how to make underscore globally?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需分配它即可。
Just assign it.