I am interesting in understanding why 032*2 returns 52 in JavaScript.
I have a feeling that 032 could be interpenetrated as octal notation but I could not find a proper reference to it.
Could you please:
Thanks in advance your help on this.
Numbers starting with 0 are Octal. So, 032 === 26.
To convert it into Base-10/Decimal number use parseInt with radix 10.
parseInt('032', 10) * 2; // 64
From MDN Docs:
If radix is undefined or 0 (or absent), JavaScript assumes the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With