const a = 1000000;
const b = 1_000_000;
now if i checked
console.log(1000000 === 1_000_000);
and it's return true
Why 1000000 and 1_000_000 both are same in javascript?
const a = 1000000;
const b = 1_000_000;
now if i checked
console.log(1000000 === 1_000_000);
and it's return true
Why 1000000 and 1_000_000 both are same in javascript?
Because the underscores are optional and purely for legibility.
Be careful using them in native JavaScript though, since they're not supported in all browsers: CanIUse