Published at
Updated at
Reading time
1min

Suppose you're dealing with big numbers in JavaScript, you might know that they're becoming harder to read with every digit. Look at 123456789 โ€“ how many millions is that? I don't know! ๐Ÿคทโ€โ™‚๏ธ

To solve this readability issue JavaScript implements numeric separators.

// Make large numbers more readable with numeric separators

console.log(1_234_456_789.01);
// 1234456789.01

I was aware that the language addition is around the corner, but surprisingly, I just realized, they're cross-browser-supported these days! ๐ŸŽ‰

MDN Compat Data (source)
Browser support info for Numeric separators (`1_000_000_000_000`)
chromechrome_androidedgefirefoxfirefox_androidsafarisafari_iossamsunginternet_androidwebview_android
7575797070131311.075

If you enjoyed this article...

Join 6.3k readers and learn something new every week with Web Weekly.

Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles