+ 3

What will happen when we write if-else statement WITHOUT using IF statement

14th Mar 2018, 8:59 AM
ShriekDj
5 Antworten
+ 5
doesnt work, also makes no sense
14th Mar 2018, 9:03 AM
Jeremy
Jeremy - avatar
+ 9
you can have an if(){} without else{} but you cant have an else{} without if(){} 👍
14th Mar 2018, 9:16 AM
D_Stark
D_Stark - avatar
+ 2
what is alternate to if-else and ternary operator
14th Mar 2018, 9:18 AM
ShriekDj
+ 2
I think it will not work.good question. I didn't think about that possibility.
14th Mar 2018, 2:27 PM
Thomas Kurian
Thomas Kurian - avatar
+ 1
depending on your use case: a switch statement, otherwise nothing
14th Mar 2018, 9:19 AM
Jeremy
Jeremy - avatar