Finders Keepers
The challenge I was given on freecodecamp was not that difficult after I read the problem which I was given I first though of a for-loop, but then I didn’t know from there where to go and I went to read up on freecodecamp helpful links they are proving and it help.
Problem
Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).
Approach
I used filter array with the function parameters provided and therefore I returned the first element that returns true, or undefined if no elements return true
Conclusion
It wasn’t complicated more especially after read up about filter since well I firsly thought of using a for-loop.