if I have the following object:
const obj = {
a: {
b: 'val',
},
};
and I want to destructure both a
and b
from the object, how would I go about doing it? I know this:
const { a: { b } } = obj;
but this doesn't let me access a
. How can I also make a
accessible in the code?