Joined October 2013
·

Alex Grande

San Francisco Bay Area
·

For something that is only to be instantiated once. Instead of the the classic singleton style:

Singleton = (function() {

return {
publicProperty: function() {}
}

})();

I love the prototype. I encourage using the prototype modal even in a singleton pattern.

(function() {
function CoolClass() {};
CoolClass.prototype.coolestOfThemAll = function() {};

return new CoolClass(); 

})();

Achievements
1 Karma
0 Total ProTip Views