Merge pull request #463 from michaelficarra/patch-2

`_.difference` should perform a shallow flatten
This commit is contained in:
Jeremy Ashkenas
2012-02-06 09:28:41 -08:00

View File

@@ -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); });
};