Making large numbers readable in JavaScript
javascript, long-integer, numbers, readability
Solution
Add underscore
`100_000_000_000`
`const loopCount = 50_000`
`for (var i=0; i < 1_000_000; i++){ codecodecode};`
for more information go here (https://2ality.com/2018/02/numeric-separators.html)
Problem
I'm wondering if there is a way to make large numbers readable in JavaScript. I'm sure there is I just can't find it. For example, if I am writing ``` for (var i=0; i < 1000000; i++){ codecodecode}; ``` is there a way to write that 1000000 so that it's readable without disrupting the for loop? Furthermore, is there a way of returning a large number so that, too, is readable? Sorry if I explained this poorly, I'm just starting out... Thanks in advance!