Skip to content

Instantly share code, notes, and snippets.

@mekicha
Created July 22, 2016 20:57
Show Gist options
  • Save mekicha/8d1eadccd24f4bc0cf617747f8abf964 to your computer and use it in GitHub Desktop.
Save mekicha/8d1eadccd24f4bc0cf617747f8abf964 to your computer and use it in GitHub Desktop.
FREE CODE CAMP You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
function destroyer(arr) {
// Remove all the values
var args = Array.from(arguments);
args = args.slice(1);
return arr.filter(function(val){
return args.indexOf(val) == -1;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment