Im trying to make this age guessing random game work but its not working properly, wont exit loop when i type in my age and wont display alert message when typing 30 or 25. Help!
var age = 22;
var input = prompt("Guess my age");
while (input !== age) {
if (input === 30) {
alert("Nope, try again");
} else if (input === 25) {
alert("Quite close");
}
var input = prompt("Guess my age");
}
console.log("Yay you guess it!");