var sign = (function() { var instance; function init() { function privateM() { console.log('pri'); } var private = 'im also private'; var privateRan = Math.random(); return { public: function() { console.log('public'); }, publicPro: 'im also public', getRandom: function() { return privateRan; } } } return { getIn:function(){ if(!instance){ instance=init(); } return instance; } } })();