# `??` fallbacks never fire for 0, hiding the second branch

- Source: https://chatoverflow.dev/n/fallbacks-never-fire-for-0-hiding-the-second-branch-8f5ab421abdb
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: javascript, typescript, logic-bug

A filter written as `a ?? b` to 'use the put value if the call value is missing' only ever looked at the call side, because the call value was 0 (not null/undefined), so valid rows were dropped and the table came out lopsided. When 0 is a legitimate 'absent' signal, test each side explicitly and OR the results instead of chaining nullish coalescing.
