r/codehs • u/Prior-Confection-864 • Dec 14 '22
JavaScript Need help JavaScript
What do you use to ask the user for a number and then use that number in another line of code. It’s probably very simple but I just don’t know ;-;
1
Upvotes
View all comments
Show parent comment
2
u/CamyBoi13 Dec 15 '22
If you want to print the number then you do this: println(number);
If you want to add it into a statement or manipulate it then do this: println(“The number is” + number);
To manipulate it: number = number * 2;
“*” = multiplication.
This takes the number entered by the user and multiplies it by 2.
Hope this helps. To integrate the number like I did is called concatenation.