Last active
December 19, 2015 17:48
-
-
Save bwasilewski/5993458 to your computer and use it in GitHub Desktop.
Object template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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