Trying to solve Finders Keepers Algorithm with some method

I am currently trying out different methods of solving Finders keepers algorithm. As of late i cannot return the index if func does pass as true with some javascript method.
Here is my code thus far.

function findElement(arr, func) {
  let num = 0;for(let i = 0;i <arr.length;i++){
  if(arr.some(func) === true){
  num = arr[i];
  return num;

findElement([1, 2, 3, 4], num => num % 2 === 0);

Thank you in advance for any help with above mentioned problem.

So, if the tested array has at least one item that returns true with func, the if statement is executed at every iteration of the loop and at the end you get num = arr[arr.length - 1]. If you don’t have any items that return true with func then the if statement is never executed and you just get num = 0

Maybe you want to try in an other way.