Skip to content

Instantly share code, notes, and snippets.

@xcambar
Created September 27, 2012 08:22
Show Gist options
  • Save xcambar/3792865 to your computer and use it in GitHub Desktop.
Save xcambar/3792865 to your computer and use it in GitHub Desktop.
Module Pattern
var AdamsModule = (function (foo, bar) {
var theAnswer = 42;
var questionFromAnswer = function () { /** ? **/ };
return {
getTheAnswer : function () { return theAnswer; },
computeQuestion : function () {
questionFromAnswer(this.getTheAnswer());
}
}
})(foo, bar)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment