开发者

What does "_" means here?

开发者 https://www.devze.com 2023-02-19 05:31 出处:网络
I am learning backbone.js, in it\'s tutorial, it has the following code var object = {}; _.extend(object, Backbone.Events);

I am learning backbone.js, in it's tutorial, it has the following code

var object = {};
_.extend(object, Backbone.Events);
...

I don't understand the "_" in the code, wha开发者_开发百科t does it means? and what is this "extend"? does it has the same meaning as jQuery.extend ?


From Backbone's own homepage :

Backbone's only hard dependency is Underscore.js.

_ is the object created by Underscore.js, in the same way as $ is the jQuery object

http://documentcloud.github.com/underscore/#extend as for what _.extend does.


It copies all the Backbone.Events properties over to the object. Extend is a method from the underscore library: http://documentcloud.github.com/underscore/#extend

I'd say it's the same as the jQuery method.

0

精彩评论

暂无评论...
验证码 换一张
取 消