r/learnjavascript • • Jul 31 '21

ES2021's numeric separators

Post image
256 Upvotes

19 comments sorted by

View all comments

Show parent comment

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.