Tell us what’s happening:
It should works but
Your code so far
const squareList = (arr) => {
// Only change code below this line
return arr
.filter(n => n > 0 && Number.isInteger(n))
.map(n => Math.pow(n, 2));
// Only change code above this line
};
const squaredIntegers = squareList([-3, 4.8, 5, 3, -3.2]);
console.log(squaredIntegers);
only single test does not passing:
// running tests
[ 25, 9 ]
map, filter, or reduce should be used.
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0
.
Challenge: Use Higher-Order Functions map, filter, or reduce to Solve a Complex Problem
Link to the challenge: