Finders Keepers - is it this easy?

Finders Keepers - is it this easy?
0

#1

I having second thoughts about whether this is good or not, because I wrote this code in under one minute and it passes the whole challenge. Is there any hidden catch to this challenge? :slight_smile:

function findElement(arr, func) {
  var num = 0;
  var filtered = arr.filter(func);
  return filtered[0];
}

#3

Thanks @P1xt!
As short as any of my solutions seem to be, you are bound to have a shorter one. You are an amazing coder :slight_smile:


#5

oh man, this one might be a jog :smile:


#6
function findersKeepers(arr, fun) {
  return arr.find(fun);
}