1 let maximum = 10; 2 let computer = Math.floor(Math.random() * maximum) + 1; 3 4 let stillPlaying = true; 5 while (stillPlaying) 6 { 7 let guess = prompt("Guess a number from 1 to " + maximum + "."); 8 guess = parseInt(guess); 9 10 if (guess < 1 || guess > maximum) 11 { 12 alert("That’s out of range."); 13 } 14 else if (guess === computer) 15 { 16 alert("You guessed it!"); 17 stillPlaying = false; 18 } 19 else if (guess > computer) 20 { 21 alert("Your guess is too high."); 22 } 23 else if (guess < computer) 24 { 25 alert("Your guess is too low."); 26 } 27 } 28