您的位置:首页 > Web前端 > JavaScript

underscore.js _.union[Array]

2012-04-15 23:07 253 查看
Computes the union of the passed-in arrays: the list of unique items, in order, that are present in one or more of the arrays.

返回数组中的并集

_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
=> [1, 2, 3, 101, 10]


源码:

_.union = function() {
return _.uniq(_.flatten(arguments, true));
};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: