ES6/7

Watch User Created Playlist (1)

This playlist is user created.

pro-course-rss-logo

PRO RSS Feed

The difference between the Spread and Rest syntax

P
javascript tutorial about The difference between the Spread and Rest syntax

The difference between the Spread and Rest syntax

2:36 javascript PRO

In this lesson I cover the difference between the Spread and Rest syntax using an array of animals as an example. Spread is used to expand a list of items into an array or object and Rest is often used to help deal with function arguments, but can be used in a variety of circumstances to collect all items remaining excluding the assigned ones.

Additional Resources:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?