Loading section...

Short-circuit Evaluation

Default Values Pattern If the left value is falsy, the right value is used as default. Guard Clauses Short-circuiting prevents errors by skipping expressions that would fail. The second expression is never evaluated if the first determines the result: The second expression is never evaluated if the first determines the result. Order matters in guard clauses. Always put the cheaper/safer check first: