BigInt() constructor

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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
BigInt
67
79
68
No
54
14
67
67
68
48
14
9.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/BigInt