diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions.english.md index b4e174aa1d..3942dd1f9f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions.english.md @@ -71,6 +71,16 @@ console.log(squaredIntegers);
```js -// solution required +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 => Number.isInteger(num) && num > 0).map((x) => x * x); + // change code above this line + return squaredIntegers; +}; +// test your code +const squaredIntegers = squareList(realNumberArray); +console.log(squaredIntegers); ```