Tell us what’s happening:
I don’t know if the plugin is not working well or what. This code seems OK to me and verified against other solutions I’ve seen.
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 = arr.filter((x) => x%1 === 0);
squaredIntegers = squaredIntegers.map((x) => x*x);
// 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_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.
you probably made an oversight in this line
const squaredIntegers = arr.filter((x) => x%1 === 0);
it is x%2 not x%1. For your case the filter was basically doing nothing as every integer in the array list is divisible by 1.