Created
December 19, 2019 12:23
-
-
Save wwwmarcos/a0e75a81308866efe431e67403aa3aaa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const myArray = [1, 2, 3] | |
myArray.push(...[5, 6, 7]) | |
console.log(myArray) // Array(6) [ 1, 2, 3, 5, 6, 7 ] | |
const newArray = [...myArray, 8, 9, 10] | |
console.log(newArray) // Array(9) [ 1, 2, 3, 5, 6, 7, 8, 9, 10 ] | |
const anotherArray = newArray.concat([11, 12]) | |
console.log(anotherArray) // Array(11) [ 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment