宏任务:
定时器,ajax,读取文件
微任务:
promise.then
(只有 then 是异步的,放在 new Promise()里的代码是同步的)
async 是 new promise 的简写
1 | //以下两个函数式一样的 |
await 关键字
1 | async function fun1() { |
综合题:
1 | console.log(1) |
By QuHou ; Published on 2025-03-26
定时器,ajax,读取文件
promise.then
(只有 then 是异步的,放在 new Promise()里的代码是同步的)
async 是 new promise 的简写
1 | //以下两个函数式一样的 |
await 关键字
1 | async function fun1() { |
综合题:
1 | console.log(1) |