_.defaults(object,*defaults)
用defaults对象填充object中undefined属性,并返回这个object
源码部分:
_.defaults = function(obj){ //对第二个参数进行遍历,也就是defaultObject _.each(slice.call(arguments, 1), function(source) { if (source) { for (var prop in source) { //如果obj里面没有这个key为prop的,那就用source里面的顶 if (obj[prop] === void 0){ obj[prop] = source[prop]; } } } }); //最后返回 return obj; }
相关推荐
You'll also learn how to use Underscore.js as a base for your own modules and libraries within an object-oriented or functional programming style, and will be able to explore Underscore.js use cases ...
Take advantage of object-oriented or functional programming techniques with Underscore.js Leverage Underscore.js to create code that targets client, server, or database contexts Extend Underscore.js ...
Underscore.js是目前最好用的Javascript工具包,提供了100多个函数。Underscore.php是Underscore.js的PHP移植版,并且实现了部分Underscore.js中的功能! 我花了一个月的时间将Underscore.php的文档翻译为中文,开源...
underscore.js的开发文档,需要使用的朋友们可以看看
underscore-min.js
underscore.js underscore.js underscore.js
underscore源码学习计划
Underscore1.8.3 参考手册.CHM,Underscore中文教程,Underscore离线手册
underscore js工具类,underscore为集合类对象提供了一致的接口
underscore源码解析
underscore-1.6.0.zip
underscore-1.4.3.zip
使用第三方模块Underscore.js,Immutable.js,UUID(源代码+截图)使用第三方模块Underscore.js,Immutable.js,UUID(源代码+截图)使用第三方模块Underscore.js,Immutable.js,UUID(源代码+截图)使用第三方模块...
1.2.3的Underscore中文文档,采用网页版压缩制成的chm文件,方便查看,方便点击链接
underscore javascript库 使用教程.zip
underscore.js api文档 chm
You’ll also learn how to use Underscore.js as a base for your own modules and libraries within an object-oriented or functional programming style, and will be able to explore Underscore.js use cases...
backbone.js,underscore.js,jquery-1.10.2.js
underscore+anjularJS的中文API chm格式的文档 便于查询 下载后如果打开空白 先要右键 解除锁定 ,其中underscore的文档非常好用