Sometimes, we want to do string and number conversion with JavaScript.
In this article, we’ll look at how to do string and number conversion with JavaScript.
How to do string and number conversion with JavaScript?
To do string and number conversion with JavaScript, we can use the parseInt
function.
For instance, we write
const n = parseInt("123");
to parse string '123'
into a number with parseInt
.
Conclusion
To do string and number conversion with JavaScript, we can use the parseInt
function.