当前位置:网站首页>async - await
async - await
2022-08-04 08:32:00 【z_Xiao Zhang classmate】
Understand:
async/await is an ES7 proposal based on Promise's final solution to asynchrony.
Where async is a modifier added before the function, the function defined by async will return the value of a Promise object resolve by default.Therefore, the async function can be directly then, and the return value is the function passed in by the then method.
await is also a modifier that can only be placed in functions defined by async.Can be understood as waiting.
await If it is a Promise object modified: You can get the content returned in the Promise (the parameters of resolve or reject), and the statement will be executed after the value is obtained;
If it is not a Promise object: treat this non-promise as the result of an await expression.
How to use async/awiait Code:
边栏推荐
猜你喜欢

经典动态规划问题的递归实现方法——LeetCode39 组合总和

【Attention】Dual Attention(DANet) & Fully Attention(FLA)

The difference between character stream and byte stream

如何设计一个注册中心

智汇华云 | 华云软件定义网络 DCI介绍

Recommend several methods that can directly translate PDF English documents
![[STM32] STM32F103 series name and package, memory](/img/01/073f970c8c05ad24f976b26790ba61.png)
[STM32] STM32F103 series name and package, memory

JMeter 常用的几种断言方法,你会几种呢?

LeetCode 135. 分发糖果

【JS 逆向百例】某网站加速乐 Cookie 混淆逆向详解
随机推荐
js-第一个出现两次的字母
Distributed Computing Experiment 4 Random Signal Analysis System
一天搞定JDBC02:开启事务
关于#sql#的问题:后面换了一个数据库里面的数据就不能跑了
金仓数据库 KDTS 迁移工具使用指南 (4. BS 版使用说明)
解决报错: YarnScheduler: Initial job has not accepted any resources
推荐几种可以直接翻译PDF英文文献的方法
ShuffleNet v2 network structure reproduction (Pytorch version)
一天学会JDBC03:Statement的用法
【UE虚幻引擎】UE5三步骤实现AI漫游与对话行为
给Unity Behavior Designer(Unity行为树) 的Can See Object 画圆锥辅助图
【JS 逆向百例】某网站加速乐 Cookie 混淆逆向详解
华为设备配置VRRP与路由联动监视上行链路
DWB主题事实及ST数据应用层构建,220803,,
一天学会JDBC04:ResultSet的用法
金仓数据库KingbaseES客户端编程接口指南-JDBC(6. JDBC 大对象数据处理)
binder通信实现
【Attention】Dual Attention(DANet) & Fully Attention(FLA)
C# DirectoryInfo类
技术实现 | 图像检索及其在高德的应用