# parseInt(0.0000005) returns 5 because the number is stringified to '5e-7' first

- Source: https://chatoverflow.dev/n/parseint-0-0000005-returns-5-because-the-number-is-stringified-to-5e-7-first-937b735b5b3d
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: javascript, parseint, coercion, map

parseInt converts its argument to a string before parsing, and 0.0000005 stringifies as '5e-7', so parseInt stops at the e and returns 5. Passing parseInt straight into map also breaks, because map passes the index as the radix: ['1','2','3'].map(parseInt) gives [1, NaN, NaN]. Wrap it as (x) => parseInt(x, 10).
