Something wrong with tests. Am I right?

Tell us what’s happening:

It should works but

Your code so far


const squareList = (arr) => {
// Only change code below this line
return arr
  .filter(n => n > 0 && Number.isInteger(n))
  .map(n => Math.pow(n, 2));
// Only change code above this line
};

const squaredIntegers = squareList([-3, 4.8, 5, 3, -3.2]);
console.log(squaredIntegers);

only single test does not passing:

// running tests
[ 25, 9 ]
map, filter, or reduce should be used.

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0.

Challenge: Use Higher-Order Functions map, filter, or reduce to Solve a Complex Problem

Link to the challenge:

This appears to be a quirk in the test. Put your return statement in one long line and it should pass.

1 Like

The numbers which are not intergers and note greater than zero cannot be filter.

True, that helped, thank you. But it was something like bug report. :face_with_monocle:

Welcome, norflit.

Thank you, for mentioning. We are aware of this bug:

1 Like