| 123456789101112131415161718192021 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- // BigInt 处理超大整数 精度不丢失
- // 9007199254740991 最大的安全整数
- let a = 9007199254740991n+ 1n;
- console.log(typeof a)
- console.log(9007199254740991n +200n)
- console.log(typeof BigInt(123))
- console.log(typeof 123n)
- console.log(9n > 55n)
- </script>
- </body>
- </html>
|