- Notifications
You must be signed in to change notification settings - Fork84
Rest/Spread Properties for ECMAScript
tc39/proposal-object-rest-spread
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ECMAScript 6 introducesrest elements for array destructuring assignment andspread elements for array literals.
This proposal introduces analogousrest properties for object destructuring assignment andspread properties for object literals.
Rest properties collect the remaining own enumerable property keys that are not already picked off by the destructuring pattern. Those keys and their values are copied onto a new object.
let{ x, y, ...z}={x:1,y:2,a:3,b:4};x;// 1y;// 2z;// { a: 3, b: 4 }
Spread properties in object initializers copies own enumerable properties from a provided object onto the newly created object.
letn={ x, y, ...z};n;// { x: 1, y: 2, a: 3, b: 4 }
It is a Stage 4 proposal for ECMAScript.
This proposal only iterates overown properties.See why this matters.
About
Rest/Spread Properties for ECMAScript
Resources
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.