function find(arr, func) {
//var num = 0;
//return num;
var res = arr.filter(func);
if(res.length){
return res[0];
}
return undefined;
} find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
function find(arr, func) {
//var num = 0;
//return num;
var res = arr.filter(func);
if(res.length){
return res[0];
}
return undefined;
} find([1, 2, 3, 4], function(num){ return num % 2 === 0; });