JAVASCRIPT CLIMBSChapter 2 · JS Conditionals & Logic
Boolean Operators
Use && (AND) to require both sides to be true, || (OR) to succeed if either side is true, and ! (NOT) to invert a boolean value.
Worked example
How it reads
- hasKey || hasPass evaluates to true because at least one is true
- !hasKey flips true to false

Cloud tip: Logical operators short-circuit: if the result is determined by the first condition, the second condition is not evaluated.


