mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Merge pull request #463 from michaelficarra/patch-2
`_.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.
|
||||
// Only the elements present in just the first array will remain.
|
||||
_.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); });
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user