Else If Statements
Using else if statements we can offer feedback to users even if the conditions are false.
const password = 'p@ssword123456';
if(password.length >= 12){
console.log('that password is mighty strong');
} else if(password.length >= 8){
console.log('that password is long enough');
} else {
console.log('password should be at least 8 characters long');
}
//answer: that password is mighty strong
//the above if statement runs through the if statement checking if the condition is true, if not it runs through the else if statement and checks if the condition is true. Finally if both conditions are false then it will fire the else (fallback) condition. the user will always see a result