Each level of nesting in your code represents a different path in the code, making it less expressive and less concise. This makes code harder to read, and thus less "clean". To solve for this use guard clauses to return early and limit how much nesting your code has.
Full video: • Bad Code v.s. Good Code
Prepping for your frontend interviews? Use code "conner" for a discount on my course FrontendExpert:
https://www.frontendexpert.io/conner
Socials:
TikTok: / connerardman
LinkedIn: / connerardman