JavaScript numeric separators are cross-browser supported
Written by Stefan Judis
- 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)
75 | 75 | 79 | 70 | 70 | 13 | 13 | 11.0 | 75 |
If you enjoyed this article...
Join 5.5k readers and learn something new every week with Web Weekly.
Reply to this post and share your thoughts via good old email.