We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce7a946 commit f755a3eCopy full SHA for f755a3e
src/underbar.js
@@ -690,6 +690,20 @@ var _ = {};
690
// Take the difference between one array and a number of other arrays.
691
// Only the elements present in just the first array will remain.
692
_.difference = function(array) {
693
+ var args=Array.prototype.slice.call(arguments, 1);
694
+ var testArray=array.slice();
695
+ var tempArray=[];
696
+
697
+ _.each(args, function(arr) {
698
+ tempArray=[];
699
+ _.each(testArray, function(val, key) {
700
+ arr.indexOf(val)===-1 ? tempArray.push(val) : null;
701
+ });
702
+ testArray=tempArray.slice();
703
704
705
+ return testArray;
706
707
};
708
709
0 commit comments