Number.MIN_SAFE_INTEGER

Number.MIN_SAFE_INTEGER 代表在 JavaScript中最小的安全的integer型数字 (-(253 - 1)).

Number.MIN_SAFE_INTEGER 属性的属性特性:
writable false
enumerable false
configurable false

描述

MIN_SAFE_INTEGER 的值是-9007199254740991. 形成这个数字的原因是 JavaScript 在 IEEE 754中使用double-precision floating-point format numbers 作为规定。在这个规定中能安全的表示数字的范围在-(253 - 1) 到 253 - 1之间.

由于MIN_SAFE_INTEGER 是Number的一个静态属性,你可以直接使用Number.MIN_SAFE_INTEGER, 而不是自己去创建一个Number的属性。 

示例

Number.MIN_SAFE_INTEGER // -9007199254740991
-(Math.pow(2, 53) - 1)  // -9007199254740991

规范

Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
Number.MIN_SAFE_INTEGER
Standard Initial definition.
ECMAScript Latest Draft (ECMA-262)
Number.MIN_SAFE_INTEGER
Draft

浏览器支持

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!
Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
MIN_SAFE_INTEGERChrome Full support 34Edge Full support 12Firefox Full support 31IE No support NoOpera Full support YesSafari Full support 9WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 31Opera Android Full support YesSafari iOS Full support 9Samsung Internet Android Full support Yesnodejs Full support 0.12

Legend

Full support  
Full support
No support  
No support

参阅