Your files never leave your device
Advertisement

Spread & Rest Operators

The ... syntax does two different things depending on context: spreading elements apart, or resting/gathering them together.

Spread (Arrays & Objects)

Used to copy or merge arrays and objects.

Try It Yourself

        

Rest (Function Parameters)

Used in function definitions to gather varying numbers of arguments into an array.

Try It Yourself

        

Practice

Challenge 1: Combine two arrays using the spread operator.

Related Guides

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement