Write Higher Order Arrow Functions prb

Tell us what’s happening:

In which line should i used the filter(),map(),reduce() ?

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;
  // 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 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

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

@sojib-bd This line:
const squaredIntegers = arr;

if you tell with example it will help

@sojib-bd I wrote about it in more detail here:

Discussion, Questions, and Resources for Part 1 (JavaScript - April 2018 Cohort)

It’s also possible to chain methods like: arr.map().filter().

This challenge is difficult for many of us, but as others told me when I asked, it’s very helpful for future learning to deeply understand map(), filter(), and reduce(), even if it is a little out of place in the curriculum.