+ 4

what is the difference between ELSE IF AND IF ELSE us in js

else if

11th Oct 2019, 8:55 PM
DAVID ALANYO
DAVID ALANYO - avatar
3 Answers
+ 9
if-else used in only single if else condition like this :- if (condition satisfied) { return true; } else { return false; } else if used in nexted if else condition like this :- if (condition satisfied) { return true; } else if(another condition satisfied) { return true; } else { return false; }
11th Oct 2019, 9:34 PM
A͢J
A͢J - avatar
+ 4
The else in an ifelse statemenr is nested while else if is like another if statement
30th Jun 2020, 8:25 AM
Goke Ekundayo
Goke Ekundayo - avatar
+ 2
else if goes in between the if and else conditions.
12th Oct 2019, 7:29 AM
Sonic
Sonic - avatar