Guard Clauses vs. Nested Conditionals

TLDR; a guard clause is a premature return (early exit) that “guards” against the rest of your code from executing if it’s not necessary (based on criteria you specify).
Soon after I started my career as a Ruby on Rails developer I learned about guard clauses and how they can improve code readability.