Destructuring

👋 FYI, this note is over 6 months old. Some of the content may be out of date.
const exampleObject = { a: { b: 'hi' } }

// Want to get both `a` and `b` as variables?
// You totally can do this in one line of destructuring.
const {
a,
a: { b },
} = exampleObject

← Back home