Hello,
There was I, progressing into Javascript.
“So, this is an arrow function, awesome”
Just after finishing:
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];
const squareList = (arr) => {
"use strict";
// change code below this line
let squaredIntegers = [];
for (let counter = 0; counter < arr.length; counter++)
{Math.floor(arr[counter]) == arr[counter] && arr[counter] > 0 ? squaredIntegers.push(arr[counter] * arr[counter]) : false }
// change code above this line
return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);
I was greeted by:
"loop should not be used
map, filter, or reduce should be used"
All those methods were not presented yet. Indeed, a good coder must be able to do his research, but the restriction of loops really should be in the objective briefing above “Run the Tests”, for clarity’s sake.