Created
June 17, 2018 18:04
-
-
Save AlfieDarko/945b963cf0b1f37f783eb0857ac43d31 to your computer and use it in GitHub Desktop.
concat
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
let arr = [1,2,3,4,5] | |
arr.concat(6) | |
console.log(arr) | |
// Expected output: [1,2,3,4,5] | |
let arrClone = arr.concat("I am six") | |
console.log(arrClone) | |
// Expected output: [1,2,3,4,5, "I am six"] | |
console.log(arr) | |
// Expected output: [1,2,3,4,5] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment