BigInt.prototype.valueOf()

valueOf() 方法返回 BigInt 对象包装的原始值。

语法

bigIntObj.valueOf()

返回值

表示指定 BigInt 对象的原始 BigInt 值。

例子

Using valueOf

typeof Object(1n); // object
typeof Object(1n).valueOf(); // bigint

标准

Specification Status
ECMAScript (ECMA-262)
BigInt.prototype.valueOf()
Living Standard

浏览器支持

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
valueOfChrome Full support 67Edge Full support 79Firefox Full support 68IE No support NoOpera Full support 54Safari Full support 14WebView Android Full support 67Chrome Android Full support 67Firefox Android Full support 68Opera Android Full support 48Safari iOS Full support 14Samsung Internet Android Full support 9.0nodejs Full support 10.4.0

Legend

Full support  
Full support
No support  
No support

请参阅