Acidus wrote:In octal of course! var x = 010; alert(x); //displays 8 In JavaScript, Numeric Literals with leading 0's are treated as octal literals, unless the prefix is 0x, in which case its hex.
Acidus wrote:In octal of course!
var x = 010; alert(x); //displays 8
In JavaScript, Numeric Literals with leading 0's are treated as octal literals, unless the prefix is 0x, in which case its hex.
This is exactly the way it is in C.
--timball
RE: When does 10 = 8?