var SingletonTester = (function(){ function singleton(options){ options = options || {}; this.name = 'Jackey'; this.age = options.age || 24; } var instance; var _static = { name:'Jackey', getInstance:function(options){ if(!instance){ instance = new singleton(options); } return instance; } }; return _static; })(); var test = SingletonTester.getInstance({age : 20}) console.log(test.age);