Difference between Number and parseInt in JavaScript

Arek Jaworski
2 min readJan 1, 2020

While Number and parseInt may look similarly there are a few major differences that may lead to confusion and bugs. In this article we will go through the differences and explain them one by one.

First of all, let’s note that parseInt is used to parse string values into integers with given radix. The second parameter is optional. However, it’s a bad practice not to use it…

--

--

Arek Jaworski

Software Architect — AWS/Node.JS/JavaScript Contractor and Tutor. I write about programming, computer science, algorithms and more!