Write Higher Order Arrow Functions "not an array"

Tell us what’s happening:

I am getting the error that my squaredInteger should be an array, right now it is only returning a function. (struggling with the arrow functions still…)

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 => arr.filter(Number.isInteger(arr.item)).map(arr.item * arr.item);
  console.log(typeof squaredIntegers);
  // 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/73.0.3683.103 Safari/537.36.

Link to the challenge:

I think your problem is not with arrow functions but with higher order functions, both your filter and map functions are not written correctly, higher order functions are functions that take in other functions as arguments or functions that return other functions, this can be very confusing and I suggest before trying to chain them, try to just understand them on a very basic level.

see if this will help: https://medium.com/humans-create-software/a-dirt-simple-introduction-to-higher-order-functions-in-javascript-b33bf9e19056

or google around more…

ur link helped me alot, thanks mate and have a good day!

final solution:
const squaredIntegers = arr.filter( (item) => item > 0 && Number.isInteger(item) ).map((item) => item * item);