underscore.js _.difference[Array]
2012-04-15 23:12
344 查看
Similar to without, but returns the values from array that are not present in the otherarrays.
返回数组中的差集
源码:
返回数组中的差集
_.difference([1, 2, 3, 4, 5], [5, 2, 10]); => [1, 3, 4]
源码:
_.difference = function(array) { var rest = _.flatten(slice.call(arguments, 1), true); return _.filter(array, function(value){ return !_.include(rest, value); }); };
相关文章推荐
- underscore.js _range[Array]
- underscore.js _.first[Array]
- underscore.js _.initial[Array]
- underscore.js _last[Array]
- underscore.js _reset[Array]
- underscore.js _.flatten[Array]
- underscore.js _without [Array]
- underscore.js _.union[Array]
- underscore.js _.intersect[Array]
- underscore.js _uniq[Array]
- underscore.js _.zip[Array]
- underscore.js _indexOf[Array]
- underscore.js _.lastIndexOf[Array]
- moment.js aka underscore.date.js
- underscore.js源码解析之命名空间
- (二)underscore.js框架Utility类API学习以及模型template的详细介绍
- underscore.js _.any[Collections]
- 【UnderScore.js】JavaScript 工具库,提供了一整套函数式编程的实用功能
- Underscore.js 的模板功能介绍与应用
- underscore.js学习笔记