Unpacking Data in JavaScript

Unpacking Data in JavaScript: Destructuring, Spread and Rest.

Updated

  1. Destructuring (Apprentice): Destructuring unpacks the values you need from an object or an array into variables in one line, with defaults for anything missing and new names when you want them.
  2. Spread and Rest (Apprentice): Assigning an object to a new variable doesn't copy it, so this lesson shows how spread makes real copies and merges, and how rest gathers any number of values into one.