How would you make an if else statement loop back to the beginning to get user information?
This is the code I got so far:
var age = prompt("Please enter your age");
if(age == 21 ){
alert("Happy 21st Birthday!");
}else if (age > 21 ){
alert("You are old");
}else{
alert("Please enter an age");
}
I'm trying to make it go back to the beginning to make the user enter information.
Aucun commentaire:
Enregistrer un commentaire