0

I want to declare

var a = 0213;
document.write(a);

but it not work .when console.log(a); variable different.

scorpion
  • 147
  • 9

1 Answers1

3

Numbers with a leading 0 are interpreted as octal (base 8).

Octal 0213 == decimal 139.

If you need the value 213 (decimal), leave off the leading 0.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93