A tartalom angol verzióját olvassa, mert még nincs fordítás ehhez a területi beállításhoz. Segítsen a cikk lefordításában.

The global isFinite() function determines whether the passed value is a finite number. If  needed, the parameter is first converted to a number.




The value to be tested for finiteness.

Return value

false if the argument is positive or negative Infinity or NaN or undefined; otherwise, true.


isFinite is a top-level function and is not associated with any object.

You can use this function to determine whether a number is a finite number. The isFinite function examines the number in its argument. If the argument is NaN, positive infinity, or negative infinity, this method returns false; otherwise, it returns true.


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

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

isFinite(null);      // true, would've been false with the 
                     // more robust Number.isFinite(null)

isFinite('0');       // true, would've been false with the 
                     // more robust Number.isFinite("0")


Specification Status Comment
ECMAScript 3rd Edition (ECMA-262) Standard Initial definition.
ECMAScript 5.1 (ECMA-262)
The definition of 'isFinite' in that specification.
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'isFinite' in that specification.
ECMAScript Latest Draft (ECMA-262)
The definition of 'isFinite' in that specification.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
isFiniteChrome Full support YesEdge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yesnodejs Full support Yes


Full support  
Full support

See also