Tell us what’s happening:
Your code so far
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34];
const squareList = (arr) => {
"use strict";
// change code below this line
//const squaredIntegers = [16, 1764, 36];
const another = arr.map(function(task,index,array){
squaredIntegers[0] = task[0] * 4;
squaredIntegers[1] = task[4] * 42;
squaredIntegers [2] = task[5] * 5;
return squaredIntegers;
});
// change code above this line
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions