r/learnjavascript • • Jul 31 '21

ES2021's numeric separators

Post image
256 Upvotes

19 comments sorted by

25

u/xSypRo Jul 31 '21

FINALLY, this is great

18

u/Tintin_Quarentino Jul 31 '21

2021? Could've sworn I was using this even last year

9

u/SecretAgentZeroNine Jul 31 '21

This has been a thing for a while.

4

u/StoneCypher Jul 31 '21

v8 got support in 2019. babel and typescript have had support since 2017

12

u/[deleted] Jul 31 '21

What’s the practical use of this?

35

u/KonkenBonken Jul 31 '21

Only readability

1

u/Carneasadaeverything Jul 31 '21

is it for only initiating values for a constant? how would you use this?

7

u/KonkenBonken Jul 31 '21

1_000_000 === 1e6 === 1000000

3

u/CaptainSkuxx Jul 31 '21

You can use it anywhere where you think a number is hard to read. But I guess you would mostly have these types of numbers when initiating constants.

2

u/ayi_ibo Jul 31 '21

Easier on the eyes

9

u/capt_strugglebunny Jul 31 '21

Cordial me: This is a nice addition.

Sarcastic me: Ruby says welcome to 1995.

1

u/chat_for_vaush Aug 01 '21

And Ruby got it from Perl. :)

1

u/Anevil Jul 31 '21

Yes it’s been around longer, just hasn’t highlighted like that.

-3

u/funny_games Jul 31 '21

Yeah pretty sure it’s older than ES2021?

6

u/StoneCypher Jul 31 '21

nope.

you can look it up, if you like, or you could just keep publicly guessing that people are wrong

the proposal hasn't even been updated to say it's landed yet

0

u/funny_games Jul 31 '21

Interesting! Thanks

-1

u/Bloodsucker_ Jul 31 '21

When is the W3C gonna realise JS is becoming bloated with totally unnecessary and irrelevant features that only makes the language complicated?

0

u/wc3betterthansc2 Sep 16 '22

every update since ES6 was necessary and great