Today I learned...
JavaScript Numbers
JavaScript has only one kind of number and it can be written as a decimal or not. Then extra small or large numbers can be written with scientific (exponent) notation. I thought this was interesting because usually other programming languages, like python, have specific types of numbers (integer, float) while JS groups it as one type.
JavaScript Numbers are always 64-bit floating point or double precision floating point numbers.
Integers are accurate up to 15 digits and for decimals its 17 digits. It seems like the behavior after 15 digits is the number will round to the 15 digits and the digits after become 0.
Another short entry, but hoping to have more free time soon once I'm off work and after the holidays.
Resources
The Odin Project
https://www.w3schools.com/js/js_numbers.asp
Top comments (2)
Yeah, JavaScript numbers once piqued my interest. By the way, have you seen about this one?
No, I have not seen that, but that's actually want I was planning to cover today so good timing.