if else js
if (condition) {
// statement
} else if(condition){
// statement
}else{
// statement
}
if else js
if (condition) {
// statement
} else if(condition){
// statement
}else{
// statement
}
IF else statement
var age=20;
if (age < 18) {
console.log("underage");
} else {
console.log("let em in!");
}
javascript how to do else if
if (condition1) {
// block of code to be executed if condition1 is true
} else if (condition2) {
// block of code to be executed if the condition1 is false and condition2 is true
} else {
// block of code to be executed if the condition1 is false and condition2 is false
}
Example of an IF..ELSE Statement
public class Test {
public static void main(String args[]) {
int x = 30;
if( x < 20 ) {
System.out.print("This is if statement");
}else {
System.out.print("This is else statement");
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us