Tell us what’s happening:
I had to take a look at the solution, but my problem with this challenge is that the variable “num” was not detailed prior in the docs for this challenge. Even when I took a look at the MDN prior to the spoiler, I don’t remember anywhere in this challenge where I could directly reference the actual values within the array without using a loop. I wish this was placed in the code, instead of assuming the coder would know this variable existed, since then I could run filter() and map() against something and filtering using boolean logic. IDK, this one felt way different from the challenges prior.
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 = arr;
// change code above this line
return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions