Short Circuit

Noun · Development

Definitions

  1. An evaluation strategy in which logical operators (`&&`, `||`) skip evaluating the right-hand operand when the result is already determined by the left — `false && x` never evaluates `x`, and `true || x` never evaluates `x` — widely exploited for guard clauses and safe navigation patterns.

    In plain English: When a logical expression stops evaluating as soon as the answer is known, skipping the rest — like not checking the second condition if the first already decides the outcome.

    Example: "We rely on short-circuit evaluation: `user && user.isAdmin` won't throw if user is null because the `&&` stops at the falsy left side."

Related Terms