Created
November 13, 2015 15:26
-
-
Save valikos/b5c6ee06a8efd45ec7fe to your computer and use it in GitHub Desktop.
How javaScript works with object parameters
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
var person = new Object(); | |
function setName(obj) { | |
obj.name = 'Vasiliy'; | |
obj = new Object(); | |
obj.name = 'Batman!!!'; | |
} | |
setName(person); | |
alert(person.name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment