DEV Community

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

Collapse
 
sroehrl profile image
neoan • Edited

The early return pattern helps you to write clean, performant code. And your example is ideal. However, there are of course cases where else is the best solution, so your title threw me off a little.

Collapse
 
dd8888 profile image
David Díaz

Agree with you, maybe I should add "sometimes" 😅