Skip to content

Instantly share code, notes, and snippets.

@curtis-turner
Created June 14, 2017 04:47
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 curtis-turner/b16b71f660eb28a24902fd710899fbaa to your computer and use it in GitHub Desktop.
Save curtis-turner/b16b71f660eb28a24902fd710899fbaa to your computer and use it in GitHub Desktop.
seek and destroy
function destroyer(arr) {
// Remove all the values
//console.log(arguments[1]);
//console.log(arguments[2]);
var newArr = [];
for(var i = 1; i < arguments.length; i++){
newArr.push(arguments[i]);
}
console.log(newArr);
arr.filter(function(){
if(newArr.indexOf(val) === -1){
return true;
}
else{
return false;
}
});
return arr;
}
console.log(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