The following code is an unfinished example of a guess the number game. The user may continue to guess until the correct number is given. Your task is to write the code that is missing for the game to work.
function game() {
this.number = Math.floor(Math.random() * 10);
this.gameState = true;
this.play = function() {
while(this.gameState == true) {
this.guess = prompt("Enter a number:");
// DIN KOD HÄR
}
}
}