English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
isFinite()The method determines whether the passed value is a finite number.
If the type of the value is Number, this method returns true and is equal to a finite number. Otherwise, it returns false.
With globalisFinite()Compared to the function, this method does not force the parameter to be converted to a number.
This means that only values of type Number (which are also finite) return true.
Number.isFinite(value)
Number.isFinite(451); // true Number.isFinite(-3.13); // true Number.isFinite(3-1); // true Number.isFinite(0); // true Number.isFinite("451"); // false Number.isFinite("Hello"); // false Number.isFinite("20/12/2018"); // falseTest and see‹/›
The numbers in the table specify the first browser version that fully supports the isFinite() method:
Method | |||||
isFinite() | 19 | 16 | 15 | 9 | 12 |
Parameter | Description |
---|---|
value | To test if the value is a finite number |
Return Value: | A boolean value indicating whether the given value is a finite number |
---|---|
JavaScript Version: | ECMAScript 6 |