DEV Community

Discussion on: You don't always need “else” in your "if"

Collapse
 
marlo22 profile image
marcin93

This is nice tip! In this case else statement is totally unnecessary and avoid it can improve code readability. If I'm not wrong ESLint can help respect this, because it has rule no-return-else or something like that.

Collapse
 
guilhermetoti profile image
Guilherme Toti

Thanks man! Yes, the idea is to improve code readability!
Oh, I don’t know about this ESLint rule, but it can be very helpful!