Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
These operators return operand values and short-circuit. || falls back for falsy values; ?? falls back only for null or undefined.
a || b returns a when a is truthy; otherwise it evaluates and returns b. a && b returns a when a is falsy; otherwise it evaluates and returns b. a ?? b uses b only when a is null or undefined. Therefore 0 || 10 is 10, while 0 ?? 10 is 0. A skipped right-hand operand is not evaluated.