Tell us what’s happening:
Describe your issue in detail here.
Hi all, can someone point out what’s wrong with my code?
my logic is: filter arr into positives real numbers => convert the real numbers into integers => calculate squares of those intergers.
Cheers
Your code so far
const squareList = arr => {
// Only change code below this line
let positive = arr.filter(intergers => intergers > 0);
let temp = positive.map(floats => parseInt(floats));
let square = temp.map(numbers => numbers * numbers);
return square;
// 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_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15
Challenge: Functional Programming - Use Higher-Order Functions map, filter, or reduce to Solve a Complex Problem
Link to the challenge: