parseInt()

The parseInt() function parses a string argument and returns an integer value.

For example, if a number was stored in a variable as a string, or was taken as string input from a form textbox, you could treat the string as a number by using parseInt():

numberstring= “5”;
numberint = parseInt(numberstring);