I'm currently starting to learn JavaScript. However, can someone tell me what's wrong with the program below and how come only age 18 is being accepted? When age is <18 or >18, I am getting undefined result at the chrome console when I run this code from the console:
var age = prompt("What is your age?");
if (Number(age) < 18) {
alert("Sorry, you are too young to drive this car. Powering off");
} else if (Number(age) > 18) {
alert("Powering On. Enjoy the ride!");
} else if (Number(age) === 18) {
alert("Congratulations on your first year of driving. Enjoy the ride!");
}