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

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.

主站蜘蛛池模板: 肃北| 双城市| 山丹县| 大城县| 新巴尔虎右旗| 定襄县| 赤城县| 颍上县| 长垣县| 青海省| 阿鲁科尔沁旗| 通江县| 沛县| 诸暨市| 东兴市| 新民市| 大新县| 南通市| 英山县| 牙克石市| 沂南县| 甘南县| 桃园市| 岢岚县| 宜都市| 石渠县| 十堰市| 信阳市| 泸定县| 昌都县| 江达县| 五指山市| 会东县| 新邵县| 三亚市| 宜昌市| 高碑店市| 敦化市| 乡宁县| 泊头市| 景洪市|