There is a specific numeric type, providing support for integers of arbitrary length. It’s known as biting.
You can create a bigint by appending n to the end of an integer literal. Another way of creating a bigint is to call the function BigInt, which generates bigints from numbers, strings, and so on.
Let’s see it in action:

Math Operators
Most of all BigInt is applied as a regular number, like here:

The 7/2 division will return the result rounded towards zero. All the actions with bigints return only bigints.
Also, regular numbers and bigints can be mixed, like this:

If it is required, you can convert them using either Number() or BigInt() as follows:

You should be careful with such operations. Although conversions are silent and don’t cause errors, once the bigint is too large and doesn’t fit the number type, then additional bits will be cut off.
As you know, the unary plus operator +value is widely used for converting the value to a number. But, it is not supported on bigints.
Comparisons
Comparisons (<, >) operate with numbers and bigints properly.
Here is an example:

Due to the fact that numbers and bigints are of different types, they may be equal == but not strictly equal ===. Here is an example:

Boolean Operations
Bigints behave like numbers inside if and other boolean operations. For example, inside if, 0n is will bring false, and other values -true:
if (0n) {
// never executed
}
Boolean operations (||, &&) work with bigints like numbers, as follows:

Polyfills
It can be tricky to polyfill bigints. That’s because most of the JavaScript operators behave differently with bigints compared to regular numbers. Bigints always return bigints. To emulate behavior like that, polyfill is required. It is necessary for analyzing the code and replacing all such operators with the functions.
The developers of the JSBI library use big numbers in their methods. They can be used instead of bigints. Their approach suggests writing the code in JSBI rather than native bigints. It works with numbers like with bigints internally. So, the code will be bigint-read.