_.intersection([arrays])
计算出一个包含所有传入数组交集元素的新数组。
const_=require('lodash'); vararr=_.intersection([1, 2, 3], [2, 3, 4], [1, 2, 3, 4]) console.log(arr)
_.intersectionBy([arrays], [iteratee=_.identity])
const_=require('lodash'); classCar { name=""constructor(name) { this.name=name; } } vararr=_.intersectionBy([newCar("car1"), newCar("car2")], [newCar("car11"), newCar("car2")], 'name') console.log(arr)