The BigInt()
constructor returns a value of type bigint.
Syntax
BigInt(value);
Parameters
value
- The numeric value of the object being created. May be a string or an integer.
Note: BigInt()
is not used with the new
operator.
Examples
Creating a new BigInt
BigInt(123); // 123n
Specifications
Specification |
---|
ECMAScript (ECMA-262) The definition of 'BigInt constructor' in that specification. |
Browser compatibility
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.
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BigInt() constructor | Chrome Full support 67 | Edge Full support 79 | Firefox Full support 68 | IE No support No | Opera Full support 54 | Safari No support No | WebView Android Full support 67 | Chrome Android Full support 67 | Firefox Android Full support 68 | Opera Android Full support 48 | Safari iOS No support No | Samsung Internet Android Full support 9.0 | nodejs Full support 10.4.0 |
Legend
- Full support
- Full support
- No support
- No support
See also
BigInt
class