how to destructure complex objects

JavaScript
const sampleState = {
 name: “Michael”,
 age: 36,
 location: {
   state: “OK”,
   city: “Edmond”,
   postal: “73012”
 },
 relatives: {
   wife: {
   name: “Shelley”
   }
 }
}

const { age, location: { city, state }, relatives: { wife: { name } } } = sampleState
Source

Also in JavaScript: