1const theBiggestInt = 9007199254740991n
2const alsoHuge = BigInt(9007199254740991) // 9007199254740991n
3const hugeString = BigInt("9007199254740991") // 9007199254740991n
4const hugeHex = BigInt("0x1fffffffffffff") // 9007199254740991n
5const hugeBin = BigInt("0b11111111111111111111111111111111111111111111111111111") // 9007199254740991n
1// There are two ways to create BigInt:
2
3//1. add a suffix n to any number in JavaScript
4const big = 1000000n; // 1000000n
5
6//2. call the constructor BigInt(val) and pass in a numerical value
7const bigN = BigInt(123) // 123n
8
9//strings also work
10const bigS = BigInt("234") // 234n
11const bigHex = BigInt("0xffffffffffffffff") // 18446744073709551615n
12const bigBin = BigInt("0b111") // 7n