Created
July 22, 2016 20:57
-
-
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.
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
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