Numeric separators (1_000)
An underscore inside a number makes it easier to read and does not change its value.
A numeric separator is an underscore _ that you write between the digits of a number literal. JavaScript ignores it: 10_000_000 has exactly the same value as 10000000.
It exists because long numbers are hard to read at a glance. You choose where to put it; the usual habit is groups of three digits, like a thousands comma.
It only works in code, in the literal. It does not change how the number prints: console.log shows 10000000. Number("10_000") does not understand it either and gives NaN.
It cannot go at the start, at the end, twice in a row, or next to the decimal point. In the course you see it in calls like toUsdCents(10_000_000, "COP"), where the amount is large and you want to read it without counting zeros.
Reach for it when: a number literal has four or more digits and you want to read it quickly, like amounts, limits or milliseconds.
Examples
Common mistake
console.log(Number("10_000"));Why: The separator only exists in code literals. A string with an underscore does not convert to a number.
How to write it: Remove the underscores from the string before converting it, or write the number as a literal.
