Esta tradução está incompleta. Ajude atraduzir este artigo.
A função global isFinite()
determina se o valor transmitido é um número finito. Se necessário, o parâmetro é primeiro convertido a um número.
Syntax
isFinite(testValue)
Parameters
testValue
- The value to be tested for finiteness.
Description
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
.
Examples
isFinite(Infinity); // false isFinite(NaN); // false isFinite(-Infinity); // false isFinite(0); // true isFinite(2e64); // true isFinite(null); // true isFinite("0"); // true, would've been false with the // more robust Number.isFinite("0")
Specifications
Specification | Status | Comment |
---|---|---|
ECMAScript 3rd Edition (ECMA-262) | Standard | Initial definition. |
ECMAScript 5.1 (ECMA-262) The definition of 'isFinite' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'isFinite' in that specification. |
Standard |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
See also
Etiquetas do documento e colaboradores
Colaboradores desta página:
kelvys,
ronysilvati
Última atualização por:
kelvys,