var Singleton = (function(){
function Singleton(args) {
var args = args || {};
this.name = 'SingletonTester';
this.pointX = args.pointX || 6;
this.pointY = args.pointY || 10;
}
var instance;
var _static = {
name: 'SingletonTester',
getInstance: function (args){
if (instance === undefined) {
instance = new Singleton(args);
}
return instance;
}
};
return _static;
})();
var singletonTest = Singleton.getInstance({pointX: 5});
console.log(singletonTest.pointX);