Use a default when a destructured field is missing.

Destructuring Defaults

default_destructure.js
const inputName = "";
const { name = "Guest" } = { name: inputName || undefined };
const greeting = "hello " + name;

console.log("name=" + name);
console.log("greeting=" + greeting);
destructuring-defaults A destructuring pattern can include defaults. The default is used when the source value is `undefined`.