Adding a guess loop to my Javascript number guessing game
I'm pretty new at Javascript and I've built a simple number guessing game. The program generates a random number between 1-10 and prompts you if your guess is too high or too low. If you guess right, you win.
I'd like to improve on this current version by giving the player 3 guesses, after which the player either wins, or loses. I know this is done with loops, but I can't for the life of me figure out how. I've tried using while loops but it doesn't work. Here is my code and thank you all for your help: