Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Created June 6, 2013 06:41
Show Gist options
  • Select an option

  • Save clouddueling/5719732 to your computer and use it in GitHub Desktop.

Select an option

Save clouddueling/5719732 to your computer and use it in GitHub Desktop.
Javscript modular pattern
var NewsWidget = (function(window, document, undefined){
// private
var name = ‘Chris’;
function createMember() {
}
// public
return {
getName: function() {
return name;
},
create: createMember,
update: function() {
}
}
})(this, document);
NewsWidget.create();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment