Last active
October 2, 2018 04:58
-
-
Save nluo/d11bfa563b0d400b645722e55aa47e60 to your computer and use it in GitHub Desktop.
Pass by reference demo
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
function changeArr (arr) { | |
arr.push('another suburb') | |
} | |
const suburbs = ['Luctwyche', 'Chemside'] | |
changeArr(suburbs) | |
console.log('suburbs is ', suburbs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment