3.9 intersection

3.9.1语法

_.intersection(arrays)

3.9.2说明

返回一个数组:由所有属于数组A且属于数组B的元素所组成的集合(和数学上的交集很像)。

3.9.3示例

var res = _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
console.log(res);
//=>
//[1, 2]