特殊函数
var i = 0 Object.defineProperty(window,'x',{ get(){ return ++i } }) function Fn(){ if(this.constructor == Fn){ this.id =i }else{ let obj = {} obj.__proto__ = Fn.prototype obj.id = i return obj } }
function Fn(){ !Fn.prototype.n && (Fn.prototype.n = 0) if(new.target == Fn){ this.id = ++Fn.prototype.n }else{ let obj = {} obj.__proto__ = Fn.prototype obj.id = ++Fn.prototype.n return obj } }
以自己现在的努力程度,还没有资格和别人拼天赋