Node: Numeric separators support

Created on 25 Jun 2019  路  3Comments  路  Source: nodejs/node

This new feature is already in Chrome 75+

Large numeric literals are difficult for the human eye to parse quickly, especially when there are lots of repeating digits:

   1019436871.42

To improve readability, this JavaScript language feature enables underscores as separators in numeric literals. So, the above can now be rewritten to group the digits per thousand, for example:

    1_019_436_871.42

Now it鈥檚 easier to tell that the first number is a trillion, and the second number is in the order of 1 billion.

and here is it's repository:

https://github.com/tc39/proposal-numeric-separator

question

Most helpful comment

It will land in the next release 12.5.0, probably this week.

All 3 comments

You can enable this by passing the --harmony-numeric-separator option to node.

@targos when does V8 7.5 land in a release?

It will land in the next release 12.5.0, probably this week.

12.5.0 has been released :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanjunzhi picture fanjunzhi  路  3Comments

jmichae3 picture jmichae3  路  3Comments

sandeepks1 picture sandeepks1  路  3Comments

dfahlander picture dfahlander  路  3Comments

akdor1154 picture akdor1154  路  3Comments