let object = {x: 3, y: 6}
let propertyName = 'x'
// the value of the destructured property is assigned to a new variable
let {[propertyName]: value} = object
console.log(value) // 3
const myTitle= 'title';
const myObject = {title: 'My Title', name: 'My Name'};
const {[myTitle]: myObjectTitle} = myObject;
console.log(myObjectTitle); // "My Title"