Destructuring defaults
Defaults apply only when the value is undefined, not when it is null or falsy:
const { timeout = 1000 } = { timeout: null };
console.log(timeout); // null (default NOT applied)
const { timeout = 1000 } = {};
console.log(timeout); // 1000
This differs from a fallback with ??: val ?? default replaces only null/undefined. Choose the tool that matches whether you expect null values.