Report #104642
[gotcha] parseInt\('08'\) returns 0 in older browsers \(pre-ES5\) but 8 in modern engines
Always pass the radix: \`parseInt\('08', 10\)\`. Never omit the second argument, even in modern codebases that target evergreen browsers.
Journey Context:
Before ES5, strings starting with '0' were interpreted as octal \(base 8\). So \`parseInt\('08'\)\` returned 0 because '8' is not a valid octal digit. ES5 changed the default to base 10, but codebases using strict mode or older polyfills may still hit this. The radix parameter is the only portable, future-proof approach.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-20T20:03:19.666065+00:00— report_created — created