also pretty big issue here: when you have arrow function, and don’t use {} around the function body, that means you are doing implicit return. But this squareList function is never called.
You have a squareList function definition two lines above, that function is just returning arr
let’s format this nicely, maybe it’s easier to see:
const squareList = (arr) => {
// Only change code below this line
const squareList = arr =>
arr.filter(num => num > 0 && num % parseInt(num) === 0).map(num => Math.pow(num, 2));
return arr;
// Only change code above this line
};
const squaredIntegers = squareList([-3, 4.8, 5, 3, -3.2]);
console.log(squaredIntegers);
there was already a function definition, if you add a new function definition, then you are creating a function that is never called
const funcA= (arr) => {
// Only change code below this line
const funcB = arr =>
arr.filter(num => num > 0 && num % parseInt(num) === 0).map(num => Math.pow(num, 2));
return arr;
// Only change code above this line
};
const squaredIntegers = funcA([-3, 4.8, 5, 3, -3.2]);
console.log(squaredIntegers);
here I have changed the names of the variables to funcA and funcB to understand better, but other than that it’s your code:
the code you found in the editor had already the definition of funcA, you just had to make sure it returned the right thing, without creating a new function
instead you created funcB, the issue is that it may or may not have the correct logic, but funcB is never called, leaving funcA just returning arr without changing it
if you understand this, and fix it, you are pretty near the solution of the challenge