oh god the reason is even stupider then I expected
Because large numbers use the
e
character in their string representation (e.g.,6.022e23
for 6.022 × 1023), usingparseInt
to truncate numbers will produce unexpected results when used on very large or very small numbers.parseInt
should not be used as a substitute forMath.trunc()
.
https://youtu.be/gihOrSdfEPs