Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LearningNerd/24b1e10d5303a808d722e5aba460ed04 to your computer and use it in GitHub Desktop.
Save LearningNerd/24b1e10d5303a808d722e5aba460ed04 to your computer and use it in GitHub Desktop.
A saved mob programming session with Learn Teach Code!
// CHALLENGE: https://www.freecodecamp.org/challenges/seek-and-destroy
/*
GOAL: Remove all elements from the initial array that
are of the same value as these arguments.
*/
// EXAMPLE TEST:
// destroyer([1, 2, 3, 1, 2, 3], 2, 3) should return [1, 1]
function destroyer(arr) {
// Convert arguments object into a real array:
var args = [].slice.call(arguments);
// Remove first item from args:
args.shift();
// Define filtering function:
// return TRUE if this number is NOT in args
function ifMatch (number) {
};
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