[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/isFinite [Back]  [Original]

isFinite() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

isFinite()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

isFinite() , . , .

In this article

function div(x) {
  if (isFinite(1000 / x)) {
    return "Number is NOT Infinity.";
  }
  return "Number is Infinity!";
}

console.log(div(0));
// Expected output: "Number is Infinity!""

console.log(div(1));
// Expected output: "Number is NOT Infinity."

isFinite(testValue)

testValue

, .

isFinite .

, , . isFinite . NaN, , false; true.

js
isFinite(Infinity); // false
isFinite(NaN); // false
isFinite(-Infinity); // false

isFinite(0); // true
isFinite(2e64); // true

isFinite("0"); // true,    false  
//    Number.isFinite("0")

Specification
ECMAScript 2027 LanguageSpecification
# sec-isfinite-number


Web Proxy Viewer  |  New URL  |  Original Page