Skip to content

Instantly share code, notes, and snippets.

Created December 9, 2015 14:32
Show Gist options
  • Save anonymous/90ce844f30e80d0b1c8a to your computer and use it in GitHub Desktop.
Save anonymous/90ce844f30e80d0b1c8a to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/patrickcurl 's solution for Bonfire: Finders Keepers
// Bonfire: Finders Keepers
// Author: @patrickcurl
// Challenge: http://www.freecodecamp.com/challenges/bonfire-finders-keepers
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function find(arr, func) {
newArr = arr.filter(func);
return newArr[0];
}
find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment