中国铁岭网获“中国地方门户十佳人气品牌大奖”
Baseline Widely available
百度 三星GalaxyTabS3(三星GalaxyTabS3(图源:CNET)三星GalaxyTabS3[参考价格]5799元[经销商]●青春畅快精彩:华为M3青春版全新华为平板M3青春版采用简洁纯粹的设计理念,机身边框采用纳米注塑工艺、CNC工艺将金属边框打磨的圆润无比,拥有良好持握感;采用了高端平板使用的一体成型技术,悬浮式设计使得屏幕与金属边框完美贴合,平板正面的传感器开孔采用隐藏式处理,细节方面诚意满满。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
The Number.isFinite()
static method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive Infinity
, negative Infinity
, nor NaN
.
Try it
console.log(Number.isFinite(1 / 0));
// Expected output: false
console.log(Number.isFinite(10 / 5));
// Expected output: true
console.log(Number.isFinite(0 / 0));
// Expected output: false
Syntax
js
Number.isFinite(value)
Parameters
value
-
The value to be tested for finiteness.
Return value
The boolean value true
if the given value is a finite number. Otherwise false
.
Examples
Using isFinite()
js
Number.isFinite(Infinity); // false
Number.isFinite(NaN); // false
Number.isFinite(-Infinity); // false
Number.isFinite(0); // true
Number.isFinite(2e64); // true
Difference between Number.isFinite() and global isFinite()
In comparison to the global isFinite()
function, this method doesn't first convert the parameter to a number. This means only values of the type number and are finite return true
, and non-numbers always return false
.
js
isFinite("0"); // true; coerced to number 0
Number.isFinite("0"); // false
isFinite(null); // true; coerced to number 0
Number.isFinite(null); // false
Specifications
Specification |
---|
ECMAScript? 2026 Language?Specification # sec-number.isfinite |