0
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?

Dhaval
  • 868
  • 12
  • 22

1 Answers1

1

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

DustInComp
  • 1,742
  • 8
  • 18