BigInt()
构造函数用来创建 BigInt
对象。
语法
BigInt(value);
参数
value
- 被创建的对象的数值。 可以是字符串或整数。
Note: BigInt()
不与 new
运算符一起使用。
例子
BigInt(123);
// 123n
规范
Specification | Status |
---|---|
ECMAScript (ECMA-262) BigInt constructor |
Living Standard |
浏览器兼容性
BCD tables only load in the browser
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.
相关链接
BigInt
class