Skip to content

Instantly share code, notes, and snippets.

@karanjamutahi
Created March 3, 2017 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karanjamutahi/8f27d3df9df7339c524d5b4aa2347c69 to your computer and use it in GitHub Desktop.
Save karanjamutahi/8f27d3df9df7339c524d5b4aa2347c69 to your computer and use it in GitHub Desktop.
Trying To Filter using params
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