Skip to content

Instantly share code, notes, and snippets.

@koozdra
Created March 31, 2017 15:27
Show Gist options
  • Save koozdra/890037f1bce67bbca32d3ef1064c82ff to your computer and use it in GitHub Desktop.
Save koozdra/890037f1bce67bbca32d3ef1064c82ff to your computer and use it in GitHub Desktop.
head and tail destructuring in javascript
const [head, ...tail] = [1,2,3];
// head 1
// tail [2,3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment