Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object deconstruction vs. shorthand property name. #549

Closed
leocavalcante opened this issue Jun 17, 2016 · 3 comments

Comments

@leocavalcante
Copy link

commented Jun 17, 2016

{foo}

I've seeing people deconstructing just like they construct new objects using shorthand property names. Since there is such standard like space after function name to distinguish function declarations from function calls, then should be nice to have a pattern for this case too.

I usually use spaces for deconstructing:
{ foo } = bar

And non-spaces for shorthand property names
const bar = {foo}

@ifraixedes

This comment has been minimized.

Copy link

commented Jun 18, 2016

My personal opinions on these kind of rules, is to choose one an used everywhere, less rules are easy to remember than having more and special case; at the end these kind of rules are a matter of style

@dcousens

This comment has been minimized.

Copy link
Member

commented Jun 18, 2016

@leocavalcante

This comment has been minimized.

Copy link
Author

commented Jun 18, 2016

My bad, I searched for deconstruction instead of destructuring.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.