bigint(JavaScript Variable data type)

Japanese version.

The bigint data type in JavaScript is used to represent very large integers that cannot be handled by the standard number data type.

It's worth noting that bigint is a relatively new feature in JavaScript, introduced in ES2020, and may not be supported by older browsers.

A bigint value is represented by adding an "n" at the end of the number. For example, it can be declared as follows:

let bigInt = 123456789012345678901234567890n;

The bigint type can be calculated in the same way as the number type, but a conversion is required for calculations involving the bigint and nunber types.

let x = 12n; // bigint
let y = 15; // number
console.log(x + BigInt(y));