Skip to content

Instantly share code, notes, and snippets.

@amadeus
Created January 10, 2014 19:36
Show Gist options
  • Select an option

  • Save amadeus/8361074 to your computer and use it in GitHub Desktop.

Select an option

Save amadeus/8361074 to your computer and use it in GitHub Desktop.
(function(){
var obj = {
name: 'No Name'
};
window.setName = function(name){
obj.name = name;
};
window.getName = function(){
return obj.name;
};
})();
getName(); // returns 'No Name'
setName('Test Name');
getName(); // returns 'Test Name'
obj; // Error, undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment