Higher-Order Functions map, filter, or reduce to Solve

Tell us what’s happening: one of the requirement fails to solve after all requirements are met

Your code so far


 const squareList = (arr) => 
//Only change code below this line 

   return arr
   .filter(num => num > 0 && num % parseInt(num) === 0)
           .map(num => Math.pow(num, 2));
 // Only change code above this line
 };
//   // Only change code above this line

 const squaredIntegers = squareList([-3, 4.8, 5, 3, -3.2]);
 console.log(squaredIntegers);



const squareList = (arr) => {
// Only change code below this line
return arr
        .filter(num => num > 0 && num % parseInt(num) === 0)
        .map(num => Math.pow(num, 2));
// Only change code above this line
};

const squaredIntegers = squareList([-3, 4.8, 5, 3, -3.2]);
console.log(squaredIntegers);

Your browser information:

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

Challenge: Use Higher-Order Functions map, filter, or reduce to Solve a Complex Problem

Link to the challenge:

Your code is fine, don’t break your method call to separate line, check out this link Test fails for weird reason