Skip to content

Instantly share code, notes, and snippets.

@mtroiani
Created December 12, 2015 19:55
Show Gist options
  • Save mtroiani/24d64d1452dd0a5478a5 to your computer and use it in GitHub Desktop.
Save mtroiani/24d64d1452dd0a5478a5 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/mtroiani 's solution for Bonfire: Seek and Destroy
// Bonfire: Seek and Destroy
// Author: @mtroiani
// Challenge: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function destroyer(arr) {
var args = Array.prototype.slice.call(arguments);
args.splice(0, 1);
arr = arr.filter(function(n) {
return args.indexOf(n) === -1;
});
return arr;
}
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