Home
<!DOCTYPE html> <html> <body> <h1>Demo: JavaScript BigInt Type</h1> <p id="p1">1234567890123459n = </p> <p id="p2">12345678901234569n = </p> <p id="p3">9999999999999999999n = </p> <script> //16 digit integer var int1 = 1234567890123459n; //will be 1234567890123459 //17 digit integer var int2 = 12345678901234569n; //will be 12345678901234569 //20 digit integer var int3 = 9999999999999999999n; //will be 9999999999999999999 document.getElementById("p1").textContent += int1; document.getElementById("p2").textContent += int2; document.getElementById("p3").textContent += int3; </script> </body> </html>
Result: