Exercise 4.2
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
let age = prompt("How old are you?");
|
||||
age = Number(age);
|
||||
let message;
|
||||
if(age >= 21){
|
||||
message = "You can enter and drink.";
|
||||
}else if(age >= 19){
|
||||
message = "You can enter but not drink.";
|
||||
}else{
|
||||
message = "You are not allowed in!";
|
||||
}
|
||||
console.log(message);
|
||||
Reference in New Issue
Block a user