Strange Variable Behavior in JavaScript

Strange Variable Behavior in JavaScript
0

#1

I don’t understand why in the below code the variable “g” receives a value of 16. I would appreciate any explanations.

var g = 020;
undefined
console.log(g);
16
undefined

#2

look at first column http://www.asciitable.com/ labled OCT scroll down to 020 … then look at value in DEC column


#3

Yes, I should have realized. Thank you.