Skip to content

Instantly share code, notes, and snippets.

@shikolay
shikolay / ModulePattern.js
Created October 30, 2012 01:25 — forked from paulobsf/ModulePattern.js
JavaScript Module Pattern
/*
* Source: http://www.jeremyjohnstone.com/blog/2007-12-27-useful-javascript-oo-pattern.html/comment-page-1#comment-88
*/
var myObj = function() {
// private instance variables
var foo = 33;
// pseudo static initializer
var staticInitializer = function() {
// do some code here, will run only once