else if javascript 1

else if javascript

var age=20;
if (age < 18) {
} else {
	console.log("let em in!");

Here is what the above code is Doing:
1. We create a variable called age and set it equal to 20.
2. We then create an if statement that checks if age is less than 18.
3. If age is less than 18, we print "underage" to the console.
4. If age is not less than 18, we print "let em in!" to the console.

Similar Posts