Finders Keepers Help!

Tell us what’s happening:
I have completed the half of the challenge. The other half I got stuck of it
What are the mistakes on my code. What is the steps to correct my mistakes and return as below:

findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; });

Your code so far


function findElement(arr) {

for (let num = 0; num < arr.length; num++) {
 if (arr[num] % 2 === 0) {
   return arr[num];
 }
 else {
   return undefined;
 }
}  
}


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0.

Challenge: Finders Keepers

Link to the challenge:

6 posts were merged into an existing topic: Not understanding what is the required from Finders Keepers challenge

Please do not create duplicate topics for the same challenge/project question(s). This duplicate topic has been unlisted.

Thank you.

1 Like