Created
August 9, 2015 15:34
-
-
Save svahora/068aed26d7f544b9cfb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find(arr, func) { | |
var newArr = arr.filter(func); | |
var num = newArr[0]; | |
return num; | |
} | |
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