![Convert a string into an integer (a whole number)](https://javascriptsource.com/wp-content/uploads/2022/02/Convert-a-string-into-an-integer-702x526.jpg)
Convert a string into an integer (a whole number). The second argument, 10
, is called the radix
. This is the base number used in mathematical systems. For our use, it should always be 10
.
// returns 42
parseInt('42', 10);
// also returns 42
parseInt('42px', 10);