NEED HELP!
Thanks in advance!
Hi Everyone!
I’m currently working on this practice question.
28. While loop with input.
Exercise:
- Create a program that takes a number as input from the user, and prints all numbers from 0 up to this number (hint: while …).
- Expand the program with a new while loop that requests input from the user for each “round”.
- When the user enters the number 10, the program must end.
This is my solution so far, it loops just fine and requests for input after every round, however I can’t seem to figure out where to insert the statement that’ll allow the console to display “You entered 10, the program will end now!” when a user enters the number 10.
Will need someone more experienced than me to help out
while(input != 10){
var input = prompt("Pick a 2-digit number.");
var counter = 0;
while (counter <= input){
console.log(counter);
counter++;
}
}
with thanks,
Chin