Skip to content

Instantly share code, notes, and snippets.

@gtzilla
Created April 22, 2011 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtzilla/937213 to your computer and use it in GitHub Desktop.
Save gtzilla/937213 to your computer and use it in GitHub Desktop.
JS CLosure
(function(window) {
function super_private() {
console.log("only called from inside, aka private");
}
window.myPublicObj=function() {
super_private();
}
})(window);
// use it..
myPublicObj();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment