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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's very awesome when you use guard clause to handle multiple condition instead of using if elseif else statement.
I'm a big fan of it and always use it to handle conditional statement in my code :).
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 nestedif-elseso it's quick and easy to follow :D