Skip to content

Instantly share code, notes, and snippets.

@zacker330
Created March 6, 2013 10:01
Show Gist options
  • Select an option

  • Save zacker330/5098228 to your computer and use it in GitHub Desktop.

Select an option

Save zacker330/5098228 to your computer and use it in GitHub Desktop.
about javascript's closure
var proApp = {
inner : function(){
alert(proApp.defaultSettings.arg1);
},
defaultSettings : {
arg1 : 1,
str : "string"
}
}
proApp.inner();
// will alert 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment