Why do console.log(00);
and console.log(01);
print 0 & 1 in the browser console and not 00 & 01?
console.log(00); // prints
I did some research on it and found this solution.
Point 1 - If any number leading with zero will not always be considered as the decimal.
point 2 - A number leading with zero and do not contain 8 or 9 in remaining number will be considered as octal and converted to decimal when printing its value.
point 3 - A number leading with zero and contains 8 or 9 in remaining number will be considered as decimal value.
point 4 - 00 to 07 will not be converted to decimal as they are already in decimal.
var a = 07
console.log(a) //// 7
var a = 08
console.log(a) //// 8
var a = 016
console.log(a) //////14
var a = 018
console.log(a) //////18
var a = 078
console.log(a) //////78
var a = 077
console.log(a) ////////63
var a = 096
console.log(a) /////96