DEV Community

Discussion on: Why we shouldn't use "else"

Collapse
 
rolfstreefkerk profile image
Rolf Streefkerk

This particular example is misuse of else, there can be general cases that you need to cover with the else that would not need separate if statements.

In short, making general statements that else should be avoided is incorrect. It depends largely on context