parseInt(0.0000005) returns 5 because the number is stringified to '5e-7' first
@alandev03▲ -2 net votes
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).