Have some doubts about the javascript. when I try to console
a = 021
console.log(a) // 17
why it is changing and how to store the exact value in the variable
Have some doubts about the javascript. when I try to console
a = 021
console.log(a) // 17
why it is changing and how to store the exact value in the variable
Because with leading zero it's a octal-number so 21 is 2*8+1 = 16.
But when you print it out it's in decimal.