**Tell us whIat’s happening:**

Is there a better way of doing this? I’m working on a problem in the ES6 section of the beta curriculum and the lesson suggests using map, reduce or filter (had to do a fair bit of googling to get my head around these - I find it a bit odd that they’re expected to be used before they come in the functional programming section of the curriculum.

**The problem is:**

Use arrow function syntax to compute the square of only the positive integers (fractions are not integers) in the array realNumberArray and store the new array in the variable squaredIntegers.

Essentially, my code passes the tests for that lesson but I’m wondering if there’s a neater/shortermore concise way of doing this? I feel like there ought to be way to do the whole thing with filter, but I’ve not been able to come up with it.

Thanks!

**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 l.ine
const ints = arr.filter((val) => (val === Math.floor(val)));
const squaredIntegers = ints.map((num) => num*num);
// 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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36`

.

**Link to the challenge:**

https://beta.freecodecamp.org/en/challenges/es6/write-higher-order-arrow-functions