Skip to content

Instantly share code, notes, and snippets.

@valikos
Created November 13, 2015 15:26
Show Gist options
  • Save valikos/b5c6ee06a8efd45ec7fe to your computer and use it in GitHub Desktop.
Save valikos/b5c6ee06a8efd45ec7fe to your computer and use it in GitHub Desktop.
How javaScript works with object parameters
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