Write Higher Order Arrow Functions (bit of a simple questions)

Tell us what’s happening:

Hi, in the original challenge is the linke;

“const squareList = (arr) => { …”

I’m not certain why “arr” is included, I’ve completed the challenge succesfully using an annonymous function for squaredList - could anyone let me know why “arr” was originally included, I’m worried I’m missing something important.

Thank you

Your code so far


const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];
const squareList = () => {
  "use strict";
  // change code below this line
  const squaredIntegers = realNumberArray.filter((x) => Number.isInteger(x) && x > 0).map((x) => x * x);
  // change code above this line
  return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions

The stuff outside of that is for the benefit of the tests

1 Like

Thank you, was worried it was something more important

1 Like