Object Destructuring in ES6

Sarah Chima on October 31, 2017

This is a follow up article to my previous article on Array Destructuring. Except you have an idea of destructuring, you should read it. First,... [Read Full]
markdown guide
 

Great article! Picked up some tricks that I wish I knew before...

I always found confusing or misleading the syntax for assigning new variable names in object destructuring. Using : inside an object takes my mind to property assignment from right to left, not new variable assignment from left to right. Also, it is too similar to Typescript's type declaration:

const num: int = 5;

And fairly different (and less verbose than) using new variable names in import object destructuring:

import { Component as Comp} from "React";

 

I'm glad you picked up some tricks Sammy. Thank you for reading.

 

Thanks for this post! I learned some new tricks; your explanations of the pitfalls with object literal destructuring assignment with previous variable declaration were especially insightful :-)

 

I'm glad you learnt some new tricks. Thanks for reading.

 

This was quite useful. Thank you for watering down the vagueness of the concept.

 

Nice article sarah chima. I am learning a lot of things in this article.

Thanks for spending time for writing this article

 
 

Thanks for writing a great article which covers a lot of details.

 
 

Huh, got stuck on Javascript courses about Destructuring, but your post is really clear and will surely help me to defeat the evil forces of those exercices.

Thanks !

 
code of conduct - report abuse