Last active
July 21, 2019 02:39
-
-
Save lelouchB/2fef683a95a03e36e2b92177577cfb9f to your computer and use it in GitHub Desktop.
Different combining methods in Arrays
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
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