intersection
_.intersection(*arrays)
Computes the list of values that are the intersection of all the arrays. Each value in the result is present in each of the arrays.
_.intersection(*arrays)
Computes the list of values that are the intersection of all the arrays. Each value in the result is present in each of the arrays.
_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
=> [1, 2]
聯集
difference
_.difference(array, *others)
Similar to without, but returns the values from array that are not present in the otherarrays.
_.difference(array, *others)
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]
沒有留言:
張貼留言