tc39 / proposal-object-rest-spread

Rest/Spread Properties for ECMAScript
1.49k stars 85 forks source link

destruct objects with alias #64

Open FL0RIANMEYER opened 6 years ago

FL0RIANMEYER commented 6 years ago
const { name, Tags as tags } = this.state;

avoids using:

const values = {
    name,
    tags: Tags,
};

or

const tag = Tag;
const values = {
    name,
    tags,
};
hax commented 6 years ago

There is alias syntax:

const { name, Tags: tags } = this.state;
adrianheine commented 6 years ago

I think this can be closed.