Skip to content

The isFinite() type declaration doesn't specify the right type #64244

Description

@SetTrend

⚙ Compilation target

esnext

⚙ Library

The VS Code built in library

Missing / Incorrect Definition

/**
 * Determines whether a supplied number is finite.
 * @param number Any numeric value.
 */
declare function isFinite(number: number): boolean;

should be:

declare function isFinite(number: any): boolean;

Sample Code

isFinite("123");   // number as string yields true

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#difference_between_number.isfinite_and_global_isfinite

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions