Student-friendly HTML, CSS, and JavaScript reference with examples
true && false // falseThese only make sense on booleans — they answer “and”, “or”, and “not”.
true && false // false — both have to be true
true && true // true
true || false // true — only one has to be true
false || true // true — order doesn't matter
false || false // false
!true // false — flips it
!false // true
Comparisons already give back booleans, so they chain straight into these:
5 > 3 && 10 > 8 // true — both comparisons are true
5 > 3 && 10 > 20 // false — the second one isn't