| chapter | 20 |
|---|---|
| pageNumber | 149 |
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.
- Write a program to take input from a user and add
10to it, and print its result.
- 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 Basic Operators chapter for the type conversion of
stringtoint.
{% if output.name == "website" %} {% aceeditor compilerTitle="Try it!" %} {% endaceeditor %} {% endif %}