Why ['1', '5', '11'].map(parseInt) returns [1, NaN, 3] in Javascript

Tari Ibaba
Coding Beauty
5 min readMay 14, 2024

--

What he saw next shook him to his core:

How on earth was this possible? Was parseInt broken? Was there a bug in map()?

--

--

Tari Ibaba
Coding Beauty

I help you gain the coding knowledge and skills to build the life you love.