# ES6 section: Write Higher Order Arrow Functions Exercise

Hi- I’m new to js. Made it to ES6 section & hit this exercise. I finally looked at solution but I do not understand solution either…it feels like it jumped from pre-algebra to cal 1.
Can someone more advanced than I break the solution down/dissect solution for me, please? thank you!

The provided solution is chaining multiple array methods for functional programming.

arr.filter( (num) => num > 0 && num % parseInt(num) === 0 )

This code says filter the array by numbers greater than 0 and integers.

.map( (num) => Math.pow(num, 2) );

This code says take the filtered array and double each value in the array.

Finally, the returned result is assigned to squaredIntegers array as a new array.

1 Like

thanks so much for quick reply. i feel stupid asking my next question. the only time the curriculum has covered parseInt was to convert a string to an integer and then use a radix for the base. I feel so befuddled how this is needed here? how is parseInt converting a string needed to solve this?

Honestly using parseInt wasn’t necessary. There is a simpler way called `Number.isInteger()` that could have been used in place of parseInt() but I think it was used in case if given values in the parameter were string like numbers. For ex. “24” instead of 24.

1 Like