Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *instructions:
- *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(array) {
- var args = Array.from(arguments).slice(1);
- return array.filter(function(item){
- return !args.includes(item);
- });
- }
Add Comment
Please, Sign In to add comment