Skip to content

Instantly share code, notes, and snippets.

@gtzilla gtzilla/js closure
Created Apr 22, 2011

Embed
What would you like to do?
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
You can’t perform that action at this time.