what is the difference between ELSE IF AND IF ELSE us in js | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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