JS: Number.isFinite

By Xah Lee. Date: . Last updated: .

Number.isFinite ( number )

  1. If type of number is not number, return false.
  2. If number is NaN, +Infinity, or -Infinity, return false.
  3. Else, return true.

[see JS: Value Types]

console.log ( Number.isFinite ( 3 ) ); // true
console.log ( Number.isFinite ( 3.4 ) ); // true

console.log ( Number.isFinite ( "3" ) ); // false
console.log ( Number.isFinite ( Infinity ) ); // false
console.log ( Number.isFinite ( NaN ) ); // true

JS Number

  1. Format Number
  2. String to Number
  3. Random Number

Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. CSS
  3. JavaScript
  4. JS Obj Ref
  5. DOM
  6. SVG
  7. Blog