This is a common Javascript gotcha with a simple solution:
Just specify the base, or ‘radix’, like so:
parseInt('08',10); // 8
You could also use Number:
Number('08'); // 8
This is a common Javascript gotcha with a simple solution:
Just specify the base, or ‘radix’, like so:
parseInt('08',10); // 8
You could also use Number:
Number('08'); // 8