Question #95

Author: admin
tags: JavaScript  
const mars = {
  title: 'Mars',
  index: 4,
};

const myPlanet = {
  index: 0,
};

// ??

console.log(myPlanet.index); // 4
How to assign a value from a property of one object to a property of another object using the destructuring assignment syntax?
What should be inserted instead of the line // ???
{ index: myPlanet.index } = mars;
{ myPlanet.index } = mars;
({ index: myPlanet.index }) = mars;
({ index: myPlanet.index } = mars);
const { index: myPlanet.index } = mars;
const { myPlanet.index } = mars;
The parentheses around the assignment statement are required when using object literal destructuring assignment without a declaration.
Rate the difficulty of the question:
easyhard