Skip to content

ES6 - Write Higher Order Arrow Functions - No negative integers included in seed #17942

@PrinceOfShapeir

Description

@PrinceOfShapeir

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]

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions/

This topic has been closed and referenced here freeCodeCamp/curriculum#210

Thank you to nathanhannig for claiming this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions