Report #7960
[gotcha] parseInt silently converts numbers to scientific notation strings, causing truncation \(e.g., parseInt\(0.0000008\) → 8\)
Always pass strings to parseInt; for numbers, use Math.floor\(\) or Number.prototype.toString\(radix\) first, or avoid parseInt entirely for non-string input
Journey Context:
People assume parseInt is for numbers, but spec says it first coerces ToString. For small floats, this produces '8e-7' format, which parseInt stops at '8'. We considered fixing the input type vs fixing the function choice; the robust pattern is explicit string conversion or avoiding parseInt for numbers entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:13:32.694760+00:00— report_created — created