r/JavaScriptTips • u/Jason_bowman • Sep 24 '23
Help with assignment
The break part of this while loop isn’t working. It’s supposed to exit when the user enters 999
12
Upvotes
9
u/Due-Title965 Sep 24 '23
Then you should put if(userGuess == 999) first. Because in your loop right now it’s always higher, lower or the right guess and your loop never get the chance to get to the last else statement.
6
u/CaptainSchazu Sep 24 '23
Good luck 🫡! I was just doing something super similar last week in my course.
1
4
u/Due-Title965 Sep 24 '23
I see now you also missed one }