User Input Variables
Last updated
Was this helpful?
Last updated
Was this helpful?
In JavaScript, we can take input from users and use it as a variable. One doesn't need to know their value to work with them.
The content of a variable is determined by the user's inputs. The prompt()
method saves the input value as a string.
You will need to make sure that the string value is converted into an integer for calculations.
Visit the chapter for the type conversion of string
to int
.