Horje
number vs bigint js Code Example
number vs bigint js
Why BigInt ? - To represent integer values larger than 2^53
javascript bigint
const theBiggestInt = 9007199254740991n
const alsoHuge = BigInt(9007199254740991) // 9007199254740991n
const hugeString = BigInt("9007199254740991") // 9007199254740991n
const hugeHex = BigInt("0x1fffffffffffff") // 9007199254740991n
const hugeBin = BigInt("0b11111111111111111111111111111111111111111111111111111") // 9007199254740991n
javascript bigint
// There are two ways to create BigInt:

//1. add a suffix n to any number in JavaScript
const big = 1000000n; // 1000000n

//2. call the constructor BigInt(val) and pass in a numerical value
const bigN = BigInt(123) // 123n

//strings also work
const bigS = BigInt("234") // 234n
const bigHex = BigInt("0xffffffffffffffff") // 18446744073709551615n
const bigBin = BigInt("0b111") // 7n




Javascript

Related
length of elements with display none Code Example length of elements with display none Code Example
ajax header Code Example ajax header Code Example
js indexof nested array Code Example js indexof nested array Code Example
javascript canvas without html Code Example javascript canvas without html Code Example
c3 json from string Code Example c3 json from string Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8