Skip to content

Instantly share code, notes, and snippets.

@lelouchB
Last active July 21, 2019 02:39
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/2fef683a95a03e36e2b92177577cfb9f to your computer and use it in GitHub Desktop.
Save lelouchB/2fef683a95a03e36e2b92177577cfb9f to your computer and use it in GitHub Desktop.
Different combining methods in Arrays
let firstArray = [1,2,3,'Shinchan']
let secondArray = ['Nohara',4,5,6]
let combinedArray1 = firstArray.concat(secondArray)
let combinedArray2 = secondArray.concat(firstArray)
console.log(`Combined Array1 = `+combinedArray1)
// Combined Array1 = 1,2,3,Shinchan,Nohara,4,5,6
console.log(`Combined Array2 = `+combinedArray2)
//Combined Array2= Nohara,4,5,6,1,2,3,Shinchan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment