Skip to content

number vs finite #43

Description

@bishopZ

a quotation from underscore discussion:

_.isNumber( NaN ) is true because NaN is classified as a number just as
Infinity and -Infinity are.

The _.isNumber method is not intended for numeric validation just as _.isDate will not validate whether a date object is a valid date, new Date(Infinity).

If you're looking for validation there's _.isFinite or
ES6 Number.isFinite, Number.isNaN, Number.isInteger, and Number.isSafeInteger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions