Js Spread Rest — Free Javascript Tutorial
Learn Js Spread Rest in Javascript with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Js Spread Rest 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
Js Spread Rest 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 Js Spread Rest 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 →