Answers for "checking a condition using if-else"

4

IF else statement

var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}
Posted by: Guest on March-24-2021
1

IF..ELSE Statement

//An if statement can be followed ba an optional else statement, which 
//executes whe the Boolean expression is false
if(Boolean_expression) {
   // Executes when the Boolean expression is true
}else {
   // Executes when the Boolean expression is false
}
Posted by: Guest on August-31-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language