Different code with the result in warning mode.

if you use a large number in "alert" or "console.log", return an unsuccessful result. Example:

alert(999999999999999999);

Result:

1000000000000000000

But we have no problem on alert(999999999999999);oralert(99999999999999999999999999999);

+4
source share
1 answer

Since the maximum integer in js is 2 53 or 9007199254740992(see Jonathan Lonowski link, mentioned: What is JavaScript Max Int? ) Every number that exceeds this limit is no longer an integer, but a float.

, . , , , - - . , alert console.log.

+4

Source: https://habr.com/ru/post/1541903/


All Articles