How parseInt works in NodeJS?
Dec 1, 2020
The function parseInt, receives a string and return an integer.
You can also send a base as a second parameter to convert the string into a number in a determined numeric base.
Also, if the string starts with “0x” it will converted in hexadecimal base.
In the next piece of code, you can see the result of different calls.
Every time the string starts with a number, it will be converted until a character in the string is a letter.