官术网_书友最值得收藏!

What is async… await?

Asynchronous functions are functions that work asynchronously. They return a Promise class implicitly and can run concurrently. We will be discussing two major ways to define asynchronous functions. These include the following:

  • Using the native Promise class
  • Using the modern Async keyword

The await keyword is used inside an asynchronous function to resolve a promise. Async and await are usually used together for managing the control of flow in a modern asynchronous JavaScript application. Koa relies heavily on async.. await to avoid callback hell and provide a more convenient method for handling errors.

主站蜘蛛池模板: 右玉县| 谢通门县| 开江县| 鄱阳县| 顺昌县| 师宗县| 鄂托克旗| 东安县| 蕲春县| 中牟县| 济源市| 南和县| 新乐市| 银川市| 陵水| 昭通市| 宜宾市| 宜春市| 电白县| 兰考县| 郎溪县| 东海县| 盐源县| 雅江县| 蒙城县| 台南市| 永靖县| 西平县| 喀喇| 靖安县| 黔西县| 永嘉县| 平遥县| 沙洋县| 安宁市| 饶阳县| 海阳市| 水城县| 安龙县| 本溪| 合肥市|