JAVASCRIPT CLIMBSChapter 4 · JS Collections Depth
Destructuring & Spread
Destructuring lets you unpack values from arrays or properties from objects directly into distinct variables. The spread operator ... lets you copy or combine collections easily.
Worked example
How it reads
- const { name, mag } = star creates variables named name and mag from the keys of star
- [...list1, 3, 4] spreads the elements of list1 into a new array

Cloud tip: Destructuring makes unpacking function arguments or component props extremely clean and concise.


