Tell us what’s happening:
Thx guys, Ive seen a bunch of giant codes on forums. but for its work. I would like to know if a short function like that is safe. THX omw studying code
Your code so far
function findElement (arr,funct){
for(let search of arr){
if(funct(search)){
return search;
}
}
}
let fint = findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; });
console.log(fint)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Challenge Information:
Build a First Element Finder - Build a First Element Finder
https://www.freecodecamp.org/learn/full-stack-developer/lab-first-element-finder/build-a-first-element-finder