Tell us what’s happening:
It tells me to use map,filter or reduce. I dont see the problem in my code.
Your code so far
const squareList = (arr) => {
// Only change code below this line
return arr
.filter(current => current > 0 && current % 1 === 0)
.map(current => current * current);
// Only change code above this line
};
const squaredIntegers = squareList([-3, 4.8, 5, 3, -3.2]);
console.log(squaredIntegers);
Challenge: Use Higher-Order Functions map, filter, or reduce to Solve a Complex Problem
Link to the challenge: