bigint

A primitive type for whole numbers of any size, written with an n suffix such as 9007199254740993n.

In more detail

Use bigint when integers go past Number.MAX_SAFE_INTEGER or when exact whole units such as cents must never drift. bigint and number cannot be mixed in arithmetic without converting. It needs an ES2020 or later target.

Example

const largeCount: bigint = 9007199254740993n;

Related terms

Taught in

References