function A(){ if(Object.getPrototypeOf(this)!==A.prototype){ return new A() } this.sa = 'sss' } A.prototype.sb = function(){ console.log(this.sa) } A().sb() new A().sb()