Does async/await belong to microtasks?

  new Promise(function (resolve) {
    resolve();
  }).then(function () {
    console.log("");
  });
  await async2();
  console.log("async1 end");
}
async function async2() {
  console.log("async2");
}
console.log("script start");
async1();
new Promise(function (resolve) {
  resolve();
}).then(function () {
  console.log("promise2");
});

because "I"m just trying" is printed before async1 end. If async/await does not belong to Microtask, but belongs to Synchronize code, you should execute async1 end, first and then "I"ll just try". Is my understanding wrong

Mar.04,2021

async/await is just a grammar. await is followed by Promise , so what does async/await have to do with Microtask?

Menu