var number = 05000;
var addNumber = 1;
When I try to add number + addNumber
, the result seems to be incorrect.
var total = number + addNumber; // the result is 20481
Refer to the image below for the quick watch result:
https://i.sstatic.net/Hwz84.png
However, if I use the value 5000 (without 0 at the beginning), the calculation turns out to be correct. Why is that?