Write Higher Order Arrow Functions(A little help maybe?)

Tell us what’s happening:
The output is that arr is not defined, but if try to define the arr inside the function(as i am allowed to) i get the variable as double-assigned.

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.filter((arr)=>arr>0 && arr % parseInt(arr)===0).map((arr)=>Math.pow(arr,2))
  // change code above this line
  return squaredIntegers;

// test your code
const squaredIntegers = squareList(arr);

Make sure you are only changing where it says you should only change.

Looks like you modified the incoming parameter for squareList function. It should be


1 Like

Thanks for your time, but i didn’t mess with the other lines. I would use the “realNumberArray” instead of “arr”, but i used “arr” because it was the value assigned to the const. I replaced every “arr” below the bottom line and above, and also in the function with “realNumberArray”, and it worked. I think this was a typo . Thank you though.