Created
March 3, 2017 06:01
-
-
Save karanjamutahi/8f27d3df9df7339c524d5b4aa2347c69 to your computer and use it in GitHub Desktop.
Trying To Filter using params
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paramArr = []; | |
function destroyer(arr) { | |
// Remove all the values | |
for(var i =1; i<arguments.length;++i){ | |
paramArr.push(arguments[i]); | |
} | |
function seeker (value){ | |
for (var j=0;j<paramArr.length;++j) | |
return value !== paramArr[j]; | |
} | |
var finalArr = arr.filter(seeker); | |
console.log(paramArr+" --paramArr"); | |
console.log(finalArr+" --finalArr"); | |
return arr; | |
} | |
destroyer([1, 2, 3, 1, 2, 3], 2, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment