A missing preference and a deliberately disabled preference need different defaults. Nullish coalescing keeps valid false and zero values.
Worked example
console.log([false, 0, null].map((value) => value ?? "missing"));Result
[ false, 0, 'missing' ]Implementation notes
An empty string may mean an intentionally blank label. If the UI wants a placeholder for both missing and blank text, express that separate rule explicitly.
Try it yourself
Compare null, undefined, an empty string and false.
Open the JavaScript example →Editorial date July 30, 2026 · Published December 6, 2026