What happening with this parameter?

Tell us what’s happening:

So I think I know how to solve this activity but I don’t understand what is happening with the parameters being passed into the function:

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

I don’t understand what is happening here: num % 2 === 0

I realize that we are getting the remainder of a number divided by 2, but what’s going on with the === 0?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.

Challenge: Finders Keepers

Link to the challenge:

Well, lets experiment a little bit:

Does this help show what’s going on?

2 Likes

That was so simple. I was thinking too hard about it haha.

Thanks!

1 Like

Sometimes you just need to tinker and make a loop that prints stuff :smiley:

1 Like