====== 差别 ======
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
前端面试重点突破 [2021/12/22 17:48] 若愚 |
前端面试重点突破 [2021/12/22 18:01] 若愚 |
||
---|---|---|---|
行 82: | 行 82: | ||
async1() | async1() | ||
- | new Promise(function(reslove){ | + | new Promise(function(resolve){ |
console.log(' | console.log(' | ||
resolve() | resolve() | ||
行 96: | 行 96: | ||
```javascript | ```javascript | ||
const pro = new Promise((resolve, | const pro = new Promise((resolve, | ||
- | const innerpro = new Promise((resolve, | + | |
- | setTimeout(() => { | + | setTimeout(() => { |
- | resolve(1); | + | resolve(1); |
- | }, 0); | + | }, 0); |
- | console.log(2); | + | console.log(2); |
- | resolve(3); | + | resolve(3); |
- | }); | + | }); |
- | innerpro.then(res => console.log(res)); | + | innerpro.then(res => console.log(res)); |
- | resolve(4); | + | resolve(4); |
- | console.log(" | + | console.log(" |
}) | }) | ||
pro.then(res => console.log(res)); | pro.then(res => console.log(res)); | ||
行 154: | 行 154: | ||
console.log(' | console.log(' | ||
} | } | ||
+ | arr() | ||
``` | ``` | ||
行 287: | 行 288: | ||
} | } | ||
app(); | app(); | ||
- | ` | + | ``` |
- | `` | + |