#destructuring
Read more stories on Hashnode
Articles with this tag
Concept Please check the codes below. function fn({ k1 = 1 }) { return k1; } console.log(fn('Put whatever you want here.')); The conclusion of the...
Below is the example. const obj = { k1: { k11: 1 } }; const { k1: { k11 }, } = obj; // console.log(k1); // Error: k1 is not...
An error does not occur, and 'undefined' is assigned. const obj = {}; const { k } = obj; console.log(k); // undefined