DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

Play Button Pause Button
JavaScript Joel
JavaScript Joel

Posted on

INVERT IF STATEMENTS and EARLY RETURNS to improve your code readability

Inverting if statements and early returns are two techniques that can be applied that can improve your codebase.

When used properly it can reduce indentation and complexity.

links in video:
https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html
https://www.jetbrains.com/help/resharper/InvertIf.html

Be sure to subscribe for more videos like this!

Alt Text

Top comments (1)

Collapse
 
abanoub7asaad profile image
Abanoub Asaad

Thank you so much!

Build Anything...


Use any Linode offering to create something for the DEV x Linode Hackathon 2022. A variety of prizes are up for grabs, inculding $1,000 USD. ๐Ÿ‘€

โ†’ Join the Hackathon <-