Skip to content

Instantly share code, notes, and snippets.

@bwasilewski
Last active December 19, 2015 17:48
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 bwasilewski/5993458 to your computer and use it in GitHub Desktop.
Save bwasilewski/5993458 to your computer and use it in GitHub Desktop.
Object template
(function () {
'use strict';
window.Obj = function Obj () {
// Underscores for top level variables
var _self = this;
// Init object here
function init () { }
// Example private method
function privateMethod () { }
// Example public method
_self.publicMethod = function publicMethod () { };
init();
};
}());
// Private instance
// var obj = window.Obj();
// Public instance ( accessible anywhere )
// window.obj = window.Obj();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment