1//destructuring in javascript
2const objA = {
3 prop1: 'foo',
4 prop2: {
5 prop2a: 'bar',
6 prop2b: 'baz',
7 },
8};
9
10// Deconstruct nested props
11const { prop1, prop2: { prop2a, prop2b } } = objA;
12
13console.log(prop1); // 'foo'
14console.log(prop2a); // 'bar'
15console.log(prop2b); // 'baz'