Nullish coalescing, and the zero that stops being overridden

|| falls through for every falsy value, so a default applied with it overrides a legitimate zero, an empty string and false.

const timeout = options.timeout || 30;      // 0 becomes 30
const name    = user.name || 'anonymous';   // '' becomes 'anonymous'
const enabled = flags.beta || true;         // false becomes true

const timeout = options.timeout ?? 30;      // 0 stays 0
const enabled = flags.beta ?? true;         // false stays false

The third line is the one that produces an incident: a feature flag explicitly set to false reads as enabled. Mixing ?? with && or || without parentheses is a syntax error rather than a precedence surprise, which is a deliberate and good decision. Combined with optional chaining it replaces most defensive code in anything reading an API response.