Short-Circuit Evaluation
Multiple Choice Medium
Question
What does `false && console.log('hi')` do?
Hint
AND short-circuits: if the first operand is false, the second is never evaluated.
Explanation
The && operator short-circuits: if the first operand is false, the result is already determined to be false, so the second operand is never evaluated. console.log('hi') is skipped entirely. This is useful for conditional execution: condition && doSomething().
Related Resources
Related Lessons
- Boolean Logic
Learn about boolean logic and operators.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.