DEV Community

Discussion on: 5 ways to refactor if/else statements in JS functions

sylwiavargas profile image
Sylwia Vargas Author

Ahhhh I'm also such a fan of guard clauses! My first coding language is and was Ruby, which is obsessed with readable and pleasant code so of course, the looong code monsters that JS awakens from the deepest depth of programming hell gave me chills initially. I feel like my brain fries when I read nested if-elses... there should be an ESLint rule that obliges devs to draw a flowchart every time they write a nested if-else so it's quick and easy to follow :D