DEV Community

Discussion on: Six Things You Thought Senior Devs Did (But We Don't)

 
codemouse92 profile image
Jason C. McDonald

Precisely.

The only time you might need an explicit else in my experience is when one or more conditions do not contain logic to leave the context (e.g. a return, break, or continue), and you have a block of code which should only be executed if none of the conditions were met.