摘要:
function myPromise(fn){ let status='pending',successCallback=[],failedCallback=[],data=null,reason=null this.then=function(fulfilled,rejected){ if(status=='pending'){ ... 阅读全文
摘要:
function New(fn,...args){ let obj={} obj.__proto__=fn.prototype let result=fn.apply(obj,args) if(typeof result==='object'||typeof result==='function'){ return result ... 阅读全文