Skip to content

Instantly share code, notes, and snippets.

@markadrake
Created September 2, 2017 15:48
Show Gist options
  • Save markadrake/754d8c2e91febe752b75bf0d4a60055b to your computer and use it in GitHub Desktop.
Save markadrake/754d8c2e91febe752b75bf0d4a60055b to your computer and use it in GitHub Desktop.
Concatenate Arrays using the Spread Operator in JavaScript
// Concatenate Arrays using the Spread Operator in JavaScript
// CodePen: https://codepen.io/markadrake/pen/mMvYRQ
// Gist: https://gist.github.com/
let myArray = [1],
mySecondArray = [2, 3],
myLastArray = [...myArray, ...mySecondArray]; // [1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment