In this article, I will discuss two methods to add string numbers. If you use parseInt() with words and letters, it will return - NaN and it stands for Not a Number. Using the + operator alone before an element indicates a math operation and tries to convert the element to a number, and if it fails to do - it willreturn NaN.

1m read timeFrom javascriptkicks.com
Post cover image
Table of contents
Using parseInt()Using the unary plus operator

Sort: