// // guess a number game: the program picks a random number between 1 and 100, and asks you to guess it // iterative var secret = Math.floor( Math.random()* 100 ) + 1; var answer = -1; while (answer !== secret) { answer = prompt("Please guess a number between 1 and 100"); if( answer < secret ) { console.log("larger"); } else if (answer > secret) { console.log("smaller"); } else { console.log("you got it! The correct answer is: " + answer); } }