Skip to content

Instantly share code, notes, and snippets.

@AlfieDarko
Created June 17, 2018 18:04
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 AlfieDarko/945b963cf0b1f37f783eb0857ac43d31 to your computer and use it in GitHub Desktop.
Save AlfieDarko/945b963cf0b1f37f783eb0857ac43d31 to your computer and use it in GitHub Desktop.
concat
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