Skip to content

Instantly share code, notes, and snippets.

Created December 12, 2015 04:23
Show Gist options
  • Save anonymous/bd93efb93de8a95b7e94 to your computer and use it in GitHub Desktop.
Save anonymous/bd93efb93de8a95b7e94 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/dannycoder 's solution for Bonfire: Drop it
// Bonfire: Drop it
// Author: @dannycoder
// Challenge: http://www.freecodecamp.com/challenges/bonfire-drop-it
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function drop(arr, func) {
// Drop them elements.
while(!func(arr[0])){
arr.shift();
}
return arr;
}
drop([1, 2, 3], function(n) {return n < 3; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment