Write Higher Order Arrow Function thoughts

I think this challenge might be way to hard for some beginners, and I am going to be honest, the only reason I solved this challenge relatively easy was because I knew about filter and map method, otherwise I’m afraid I wouldn’t be able to solve this challenge .

The funny thing is that after I solved the challenge I checked the solution to see if they used another approach using some of the concepts taught in previous lessons, turns out the solution also used filter and map.

My question is, how can someone who has never used or seen theses methods before come up with that solution? In my honest opinion I think it’d be better if they talk about filter, map and reduce before presenting this challenge.

Thoughts?

edit: btw, what’s the easiest way to know if a number is an integer other than using Number.isInteger() method.

I thought the parseInt method only works with string but I after seeing your example I read the documentation and it also works with numbers. These are very clean solutions, thanks again.

Do they look easier than simply calling Number.isInteger()?

No, in fact it’s the other way around. But I just wanted to know, you know, out of curiosity.