ES2021 features! ↦
Hemanth HM added a page to his website that highlights new features in ES2021: logical assignment operators, numerical separators (e.g. 1_000_000
), Promise.any
, and more. So if you don’t know, now you know.
Hemanth HM added a page to his website that highlights new features in ES2021: logical assignment operators, numerical separators (e.g. 1_000_000
), Promise.any
, and more. So if you don’t know, now you know.
Discussion
Sign in or Join to comment or subscribe
2021-08-01T08:13:27Z ago
sure will never confuse anyone why number is 100 time smaller, once b/c someone misplaced an optional underscore
like, why? if you want decimals – there is a literal point
Jerod Santo
Bennington, Nebraska
Jerod co-hosts The Changelog, crashes JS Party & takes out the trash (his old code) once in awhile.
2021-08-02T13:30:09Z ago
The (100% optional) underscores represent where you’d put a comma, not a decimal. They do not change the number value whatsoever, just like commas don’t.
The reason you’d want to do this is because it’s easier to grok at a glance what a large number is:
If you showed me the first
total
and asked me what order of magnitude it was, I’d have to count how many digits there are. If you showed me the secondtotal
and asked me the same question, I would know it’s 1 billion almost immediately.