Tell us what’s happening:
I sort of understand what I need to do, conceptually, to get through this problem. But, I am not sure how to accomplish it in practice. The task I am failing is " squaredIntegers
should be [16, 1764, 36]". Any help on how to approach this problem, without being given the direct answer, would be great. Thanks, in advance!
Your code so far
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];
const squareList = (arr) => {
"use strict";
// change code below this line
const squaredIntegers = realNumberArray
.filter(realNumberArray => realNumberArray.isInteger === true)
.map(realNumberArray => Math.sqrt(squaredIntegers));
// change code above this line
return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions