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

Specification
ECMAScript Language Specification
# sec-bigint-constructor

Browser compatibility

BCD tables only load in the browser

See also