early return
Leaving a function as soon as the answer is known.
An early return (a guard clause) handles a special case at the top of a function and returns, keeping the main path unindented.
Leaving a function as soon as the answer is known.
An early return (a guard clause) handles a special case at the top of a function and returns, keeping the main path unindented.