Hello! I'm Kamijo from Development Department🔋
I would like to summarize the article as clearly as possible. Thank you very much for your continued support.
Click here for table of contents
- 1. what is split assignment?
- 2. partitioning and assignment of arrays
- 3. object partitioning and assignment
- 4. rest syntax and split assignment
What is Split Assignment?
MDN web docs
Split Array Assignment
The split assignment of an array is the same as the split assignment at the beginning of the
Write variable declarations like array literals on the left side, and write arrays on the right side.
If the number of arrays is not enough, it will be undefined.
Split object assignment
It's the same as the split assignment of an array.
Write variable declarations like object literals on the left side and objects on the right side.
Rest Syntax and Split Assignment
It can be combined with the rest syntax to aggregate the rest of the values.
In Japan, it seems to be called residual substitution.
For more information on Rest Syntax, click here.