JavaScript · Language basics

Spread syntax

Expands an iterable into a new array, object or argument list without mutating the original.

Syntax
[...a, ...b]

Example

Try it

Notes

Spread copies are shallow. Nested objects are still shared.

More in this group

Arrow function Chained comparison Comma operator Default parameter destructuring for…in for…of Function declaration

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course