I tried to compare 10 and 010 as 10 == 010
, But I got result as false
.
Then I tried to print/alert following values,
10 result 10
010 result 8
12 result 12
012 result 10
100 result 100
0100 result 64
65 result 65
065 result 53
99 result 99
099 result 99
196 result 196
0196 result 196
Same kind of results for negative numbers too,
-99 result -99
-099 result -99
-32 result -32
-032 result -26
-196 result -196
-0196 result -196
-66 result -66
-066 result -54
More Info
from (+/-)078 to (+/-)099 results are as correct.
Ex:
78 result 78
078 result 78
-87 result -87
-087 result -87
Same behavior in Chrome, FireFox, IE.
I'm wondering why this strange behavior? Is it JS bug or JS special feature. Can someone explain why this is so.
Thanks in advance.
Please comment if you need any details.