Skip to content

Instantly share code, notes, and snippets.

@lelouchB
Created July 21, 2019 02:59
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 lelouchB/189d4c80062dbf8b9614a20dc7ccc666 to your computer and use it in GitHub Desktop.
Save lelouchB/189d4c80062dbf8b9614a20dc7ccc666 to your computer and use it in GitHub Desktop.
let firstArray = [1, 2, 3, 'Shinchan']
let secondArray = ['Nohara', 4, 5, 6]
let thirdArray = [7, 8, 9, 'Himawari']
let combinedArray1 = [...firstArray, ...secondArray, ...thirdArray]
let combinedArray2 = [...secondArray, ...firstArray, ...thirdArray]
console.log('CombinedArray1 = ' + combinedArray1)
//Combined Array1 = 1,2,3,Shinchan,Nohara,4,5,6,7,8,9,Himawari
console.log('CombinedArray2 = ' + combinedArray2)
//Combined Array2 = 4,5,6,1,2,3,Shinchan,7,8,9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment