Created
June 18, 2021 22:30
-
-
Save Nixinova/a6ad07912353d4c804c1a9807433e9ab to your computer and use it in GitHub Desktop.
JavaScript: pass-by-reference demonstration
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 a = [1] | |
let b = a | |
b.push(2) | |
console.log(a) // [1,2] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment