Skip to content

Nullish Coalescing (??)

const input = 0;
const value = input ?? 10; // 0, because 0 is not null/undefined

Tip: Prefer ?? over || when falsy values like 0 or "" are valid.