JavaScript: 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 or +Infinity or -Infinity, return false.
  3. Else, return true.
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
BUY
ΣJS
JavaScript in Depth

JS Obj Reference

Number

prototype