The Utility of Rest & Spread

Learn the rest and spread parameters and how they allow us to seamlessly work with data contained in multiple objects and arrays. We'll go over their uses and in the end, we'll put them together with advanced destructuring and default function parameters to show how these new tools aggregate to give us increased functionality in an small, elegant package.

Array & Object Rest/Spread

... is called the rest operator and the spread operator, depending on its usage. It can spread items in an array out into another array. It can spread properties of an object into another object.

Array rest/spread was introduced in ES2015. Object rest/spread was introduced in 2017.

This lesson has been placed here because it ties in with the discussion of apply, call, and bind. Let’s dive in.

Spread

Get hands-on with 1400+ tech skills courses.