If There Is No Property When Destructuring an Object
An error does not occur, and 'undefined' is assigned.
const obj = {};
const { k } = obj;
console.log(k); // undefined
An error does not occur, and 'undefined' is assigned.
const obj = {};
const { k } = obj;
console.log(k); // undefined