Javascript — Async/Await, Promise Trick

Vector VG
Jul 11, 2024

--

  • Async function always returns promise object. No need to explicitly return promise object. Only if you want to customize then and catch
  • Function without async keyword that explicitly return promise object, would become async function.
  • Await is used in async function (function with async keyword). It is to wait result from async process.

--

--