Created
September 2, 2017 15:48
-
-
Save markadrake/754d8c2e91febe752b75bf0d4a60055b to your computer and use it in GitHub Desktop.
Concatenate Arrays using the Spread Operator in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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