JavaScript's OTHER most unused primitive... BIGINT

preview_player
Показать описание

The maximum safe integer that JavaScript's number primitive can represent is 9,007,199,254,740,991 which is obviously very large, but it is also important to be aware of this limitation as numbers start to behave unpredictably past this point and might break your app.

MY GEAR:

0:00 bigint and MAX_SAFE_INTEGER
0:58 How numbers are stored
1:29 The problem
2:14 Going beyond the MAX_SAFE_INTEGER
3:08 The solution
3:18 Does it really matter?

#angular #javascript

Рекомендации по теме
Комментарии
Автор

I love solving problems that would probably never happen.

Great video btw

guilhermehenrique
Автор

0:26 I am pretty sure that BigInt is way more well known and used than Symbol. If you do anything with numbers in JavaScript you probably know about BigInt, but almost no one uses Symbol.

jaymr
Автор

Bigint is used very heavily on the web3 side of things

bhavyakukkar
Автор

It's just not very big and doesn't combine with numbers. It's not suitable for actual arbitrary accuracy.
It's useful to enable 64-bit-wise operations, because regular numbers only go up to 32 bits.

danser_theplayer
Автор

Would you work in JavaScript if you work with numbers in the range of bigInt? Just curious

vredurs
welcome to shbcf.ru