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: Data 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

Reference

ECMAScript® 2016 Language Specification#sec-number.isfinite

Number Topic


  1. JS: Number Object
  2. JS: Number Constructor
  3. JS: Number.prototype
Like what you read? Buy JavaScript in Depth