BigInt() constructor returns a value of type bigint .

句法

BigInt(value);
					

参数

value

The numeric value of the object being created. May be a string or an integer.

注意 : BigInt() is not used with the new operator.

范例

Creating a new BigInt

BigInt(123);
// 123n
					

规范

规范
ECMAScript (ECMA-262)
The definition of 'BigInt constructor' in that specification.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile Server
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet Node.js
BigInt() 构造函数 Chrome 67 Edge 79 Firefox 68 IE No Opera 54 Safari No WebView Android 67 Chrome Android 67 Firefox Android 68 Opera Android 48 Safari iOS No Samsung Internet Android 9.0 nodejs 10.4.0

图例

完整支持

完整支持

不支持

不支持

另请参阅

元数据

  • 最后修改: