mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
_.difference should perform a shallow flatten
This commit is contained in:
@@ -403,7 +403,7 @@
|
|||||||
// Take the difference between one array and a number of other arrays.
|
// Take the difference between one array and a number of other arrays.
|
||||||
// Only the elements present in just the first array will remain.
|
// Only the elements present in just the first array will remain.
|
||||||
_.difference = function(array) {
|
_.difference = function(array) {
|
||||||
var rest = _.flatten(slice.call(arguments, 1));
|
var rest = _.flatten(slice.call(arguments, 1), true);
|
||||||
return _.filter(array, function(value){ return !_.include(rest, value); });
|
return _.filter(array, function(value){ return !_.include(rest, value); });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user