I noticed the test condition checks for negative values, but the initial array isn’t actually seeded with negative integers, which is instantly fixed by adding “-1” to the front of the array. Code currently passes that would fail given this addition.
const realNumberArray = [-1, 4, 5.6, -9.8, 3.14, 42, 6, 8.34];
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34];
“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.”
Link to the challenge:
You are correct. [-4, 5.6, -9.8, 3.14, 42, 6, 8.34] would give the same result and pass the test. It appears that there is no confirmation that squared integers were positive.
You could open a github issue for this so the developers could fix it.
A casual search didn’t reveal any current issues open on the specific topic. You may want to search more carefully than I before opening a new issue though.
Thanks, I’ll do that. I didn’t find anything either, probably won’t because it’s so specific, just a single value needs to be changed.