Tell us what’s happening:
I have resolved the problem but I get this message: function keyword was not used.
What is this “function” keyword that I should use??
Your code so far
return num * (num)});
```js
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 (num => num > 0 && Number.isInteger(num)).map(function(num) {
return num * (num)});
// change code above this line
return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);
// const longWords = words.filter(word => word.length > 6);
// Number.isInteger(2)
// var roots = numbers.map(function(num) {
// return Math.sqrt(num)
// });
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170.
That return and the return below are two different scopes, so they are independent. One is the return of the callback function, the other of the function you are building
Also, that is an anonymous function, doesn’t need to be defined. The issues lies elsewhere.
The message you are seeing is saying that you should use an arrow function like how you defined your squareList function instead of using function like how you did inside your .map. The exercise seems to be to use arrow functions, so changing that function definition to an arrow function should let you pass the challenge.