What you need to know

The logical OR operator treats empty strings, zero, and false as missing. The nullish operator checks only null and undefined, which is often the right behavior for configuration and user input.

How to apply it

Use value ?? fallback when zero or an empty string should remain meaningful. Add parentheses when combining ?? with logical operators so the intended precedence is explicit.

Common mistake to avoid

Do not replace every || with ?? automatically. Decide whether empty, false, or zero should trigger the fallback for that field.