Guest User

Untitled

a guest
Nov 20th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. /**
  2. *instructions:
  3. *You will be provided with an initial array (the first argument in the destroyer function),
  4. *followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments
  5. */
  6.  
  7. function destroyer(array) {
  8. var args = Array.from(arguments).slice(1);
  9.  
  10. return array.filter(function(item){
  11. return !args.includes(item);
  12. });
  13. }
Add Comment
Please, Sign In to add comment