DEV Community

Discussion on: Rename Variable While Destructuring In Javascript

Collapse
 
stephencweiss profile image
Stephen Charles Weiss

Ah, this is cool though!

If you want, you can do all three at once -- though I agree with your point that for readability, there aren't any gains here.

const { 
  name,
  family: { wife: {name: wife} } , 
  family : { animal : {name: dog } } 
  } = me;