Not understanding Use Higher-Order Functions map, filter, or reduce to Solve a Complex Problem challenge

Tell us what’s happening:
What should I do exactly in this challenge?
What I should include either in map or filter or reduce to perform:
squareList([4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2]) should return [16, 1764, 36]

(As I said, I don’t understand the challenge so I did not change the code)
Your code so far


const squareList = arr => {
// Only change code below this line
return arr;
// 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 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0.

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

Link to the challenge:

read the requirements - it asks to return an array that contains the square of the positive integers in the input, do you get why each of the elements in the input is there?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.