DEV Community

Discussion on: Object Destructuring in ES6

Collapse
 
sammyisa profile image
Sammy Israwi

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";

Collapse
 
sarah_chima profile image
Sarah Chima

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