i know i’m wrong answer not depending on function as parameter but i donno how , i passed all tests except one if i right condition for it it don’t pass to , could anyone help
Your code so far
function findElement(arr, func){
let stash = []
for (let i = 0; i < arr.length; i++){
if(arr[i].length > 5) {
stash.push(arr[i])
}
if(arr[i] % 2 == 0) {
stash.push(arr[i])
}
}
return stash[0]
};
console.log(findElement([1, 3, 5, 8, 9, 10]))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Challenge Information:
Build a First Element Finder - Build a First Element Finder
i will try to eexplain to you what i met is hard ! the func that i use as parameter how can i pass a parameter to it ? i donno how , could you gimme hint !
if you talk about camelCase naming i know about it , cuz iam old learner but i still donno where to put conditions on the sub func and when i call it on the console i get an error