Skip to content

Instantly share code, notes, and snippets.

@christiearcus
Created August 4, 2016 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiearcus/a85bcb789f91f8e131724f987320d130 to your computer and use it in GitHub Desktop.
Save christiearcus/a85bcb789f91f8e131724f987320d130 to your computer and use it in GitHub Desktop.
array-object-destructuring
const avengers = ['Natasha Romanoff', 'Tony Stark', 'Steve Rogers'];
const ['blackWidow', ...theOthers] = avengers;
// blackWidow = 'Natasha Romanoff
// theOthers = ['Tony Stark', 'Steve Rogers']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment