Member-only story

Why does \[‘1 ‘,’5',’11 ‘\]. map (parseInt) return \[1, NaN, 3\] in JavaScript

Beck Moulton
4 min readNov 10, 2024

--

What he saw next shocked him:

How is this possible? Is parseInt broken?map()Is there a bug?

He looked up in panic, eliciting Jake’s sharp and unsettling laughter.

Alex claims to be a programming expert and takes pride in fast coding and concise code.

Although he has just entered this industry, he always believes that he is stronger than the rest of the team and stubbornly goes his own way; All well intentioned suggestions were ignored by him.

But Alex will soon face catastrophic failure. This will be a painful and humble experience that he will never forget.

It all started when Alex and Cody were assigned a project task. To allow users to view the products on the e-commerce website that the team has been developing.

They are still in the entrepreneurial stage, and all data is stored and updated in CSV files.

Product name, price, quantity All the common information you can see on websites such as Amazon.

When Alex learned about the collaboration, he arrogantly sneered.

I don’t need to collaborate with anyone, okay? “He sneered at the kind engineering supervisor Jake as he typed on the…

--

--

Beck Moulton
Beck Moulton

Written by Beck Moulton

Focus on the back-end field, do actual combat technology sharing Buy me a Coffee if You Appreciate My Hard Work https://www.buymeacoffee.com/BeckMoulton

No responses yet