Created
June 17, 2018 16:51
-
-
Save AlfieDarko/f5aa59c28a6d1be8d6795d194b7f794c to your computer and use it in GitHub Desktop.
Simple array mutations
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 arr = [1,2,3,4,5] | |
arr.push(6) | |
console.log(arr) | |
// Expected output: [1,2,3,4,5,6] | |
let arrClone = arr.push(7) | |
console.log(arrClone) | |
// Expected output: 7 | |
console.log(arr) | |
// Expected output: [1,2,3,4,5,6,7] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment