Skip to content

Instantly share code, notes, and snippets.

@ArielLeslie
Created October 6, 2015 17:30
Show Gist options
  • Save ArielLeslie/3cd873ba9ff21887cbe4 to your computer and use it in GitHub Desktop.
Save ArielLeslie/3cd873ba9ff21887cbe4 to your computer and use it in GitHub Desktop.
Seek and Destroy
function destroyer(arr) {
var args = [];
for (i = 1; i < arguments.length; i++){
args.push(arguments[i]);
}
return arr.filter(function(x){
if (args.indexOf(x) >= 0)
return false;
else
return true;
});
}
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