-
-
Notifications
You must be signed in to change notification settings - Fork 44.1k
ES6 - Write Higher Order Arrow Functions - No negative integers included in seed #17942
Description
For the task: "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."
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34];
The above seeded array does not contain negative integers, causing solutions to pass that do not actually check for them. As the square of a negative number is a positive number, changing any of the integer values above to a negative number will still pass the equality test, eg. 4X4 = -4X-4 = 16, for the following test condition: squaredIntegers should be [16, 1764, 36]
This topic has been closed and referenced here freeCodeCamp/curriculum#210
Thank you to nathanhannig for claiming this issue.