The difference between the Spread and Rest syntax

Share this video with your friends

Send Tweet

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