allsetteld专题

手写Promise then/catch/resolve/reject all/allSetteld

原生 <script>const promise = new Promise((resolve, reject) => {resolve();// reject();});console.log(promise);</script>//Promise是一个构造函数//参数为一个函数,且同步自调用了(这里称它为executor)//executor中传入了两个函数,分别是resolve