DEV Community

Jennifer Tieu
Jennifer Tieu

Posted on • Edited on

2

Self-Taught Developer Journal, Day 22: TOP JavaScript Fundamentals Part 1 - Numbers

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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (2)

Collapse
 
naruaika profile image
Naufan Rusyda Faikar

Yeah, JavaScript numbers once piqued my interest. By the way, have you seen about this one?

Collapse
 
jennifertieu profile image
Jennifer Tieu

No, I have not seen that, but that's actually want I was planning to cover today so good timing.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more