Spread & Rest Operators — Free JavaScript Tutorial
Learn Spread & Rest Operators in JavaScript with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Spread & Rest Operators in JavaScript with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Spread & Rest Operators in JavaScript
Spread `...` expands an iterable (array/string) into individual elements. Used in: function calls, array literals, object literals.
Rest `...` collects remaining elements into an array. Used in: function parameters, destructuring.
Copy array: `const copy = [...original]`. Merge arrays: `const merged = [...arr1, ...arr2]`.
Copy object: `const copy = {...original}`. Override: `const updated = {...user, age: 20}`.
Learn Spread & Rest Operators step by step with Syllab's free interactive JavaScript tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full JavaScript course →