re: Object Destructuring in ES6 VIEW POST


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.

code of conduct - report abuse