In this section “Write Higher Order Arrow Functions”
My solution was
arr.map((num) => parseInt(num) == num && num >= 0 ? num * num : null ).filter((num) => num !== null);
And the FCC’s solution is
arr.filter( (num) => num > 0 && num % parseInt(num) === 0 ).map( (num) => Math.pow(num, 2) );
I think the second (FCC’s) solution is better for performance.
What do you think about it ? What do you want to say ?