Stuck at Finders Keepers. Please help

Tell us what’s happening:
Please can someone explain to me in simple words what I need to do in this challenge as I do not understand what the challenge wants me to do.

  **Your code so far**

function findElement(arr, func) {
let num = 0;
return num;
}

findElement([1, 2, 3, 4], num => num % 2 === 0);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36

Challenge: Finders Keepers

Link to the challenge:

What part in the instruction do you not understand?

" Create a function that looks through an array arr and returns the first element in it that passes a ‘truth test’."

I do not understand what I need to do here, what output am I looking for!?

The function is given two parameters, arr and func.

The challenge is referring to func as the “truth test”

How would you return the number in the array if that certain number passed the “truth test”?

Remember, you only need to return the first truthy value, not all.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.