Build a First Element Finder - Build a First Element Finder

Tell us what’s happening:

I want to have a go at this but I’m struggling with what the example is actually doing. I’ve looked at passing functions as arguments but I can’t grasp what is actually happening, have I missed a lesson or ten? If so could somebody point me to it please?

What is happening before and after the =>? Is a function being declared? If it is, which parts are parameters and which parts are the argument for the function?

Any help would be appreciated because I don’t even know where to start. Thanks.

Your code so far


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build a First Element Finder - Build a First Element Finder

You can review this theory lecture on arrow functions to help you sort it:

Working with Functions - What Are Arrow Functions, and How Do They Work? | Learn | freeCodeCamp.org

In the example, the first parameter is an array and the second parameter is an anonymous arrow function.

It might make more sense if you look at what is being passed into findElement by the tests.