-1

I would like to get a list of all the objects of the first array that are not in the second one (so _.difference() doesn't work in this case). Something like this:

_.without([0, 3, 5, 6, 7], [4, 6, 7]); // I would like this to return [0, 3, 5]

Is this possible?

4

1 回答 1

4

您可以使用一种difference(array,array)方法:

 _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
 //output=> [1, 3, 4]
于 2013-09-05T15:52:26.713 回答