Spread and Rest Operators in JavaScript

DestructuringClasses

The ... operator (spread or rest) is one of the most useful ES6 features. It has two main uses depending on context: spreading elements/properties or collecting (rest) them.

Spread Operator – Expanding

Spread expands an iterable (array, string) or object into individual elements/properties.

Spread with Arrays

Spread with Objects

Rest Operator – Collecting

Rest Parameters in Functions

Rest in Destructuring

Quick Quiz

We have reviewed and checked the materials, but errors may still occur. The content is provided for educational purposes only, so use it at your own responsibility and verify with other sources if needed.

✨ Ask Lara — your AI study partner

Unlock personalized learning support. Lara can explain lessons, summarize topics, and answer your study questions — available from the Go plan and above.


Lara helps you learn faster — exclusive to ReadyTools Go, Plus, and Max members.

Track Your Progress 🚀

Learn more easily by tracking your progress completely for free.