当前位置:网站首页>ES7 - Optimization of promise
ES7 - Optimization of promise
2022-07-03 18:12:00 【Bump】
Optimize Promise
stay es6 Optimization based on
grammar
key word :async
// key word async Return value Promise object
async function task1(){
return 'task1 ... Successful implementation ';
}
The return value is Promise object
simplify then()
key word :await
notes : Use await There has to be async Modify function
Example
async function task2(){
return 'task2 ... Successful implementation ';
}
async function task3(){
return 'task3 ... Successful implementation ';
}
//es7 await simplify then() notes : Use await There has to be async Modify function
async function test(){
let ret1=await task1();
console.log('es7-->'+ret1);
let ret2=await task2();
console.log('es7-->'+ret2);
let ret3=await task3();
console.log('es7-->'+ret3);
}
test();
Es7 Yes Promise The optimization of is completed by practice
边栏推荐
- OpenSSL的SSL/BIO_get_fd
- Count the number of pixel values in the image
- 微服务组件Sentinel控制台调用
- PHP MySQL inserts multiple pieces of data
- Win32: dump file analysis of heap corruption
- WebView module manages the application window interface to realize the logical control and management operation of multiple windows (Part 1)
- [combinatorics] generating function (use generating function to solve the combination number of multiple sets R)
- AcWing 271. 杨老师的照相排列【多维DP】
- 网格图中递增路径的数目[dfs逆向路径+记忆dfs]
- Change the single node of Postgres database into master-slave
猜你喜欢

Draw some simple graphics with MFC
![[enumeration] annoying frogs always step on my rice fields: (who is the most hateful? (POJ hundred practice 2812)](/img/50/f89092b492d0138304209a72ff05b4.jpg)
[enumeration] annoying frogs always step on my rice fields: (who is the most hateful? (POJ hundred practice 2812)

Module 9 operation

TCP拥塞控制详解 | 3. 设计空间

Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028

How to draw non overlapping bubble chart in MATLAB
![The number of incremental paths in the grid graph [dfs reverse path + memory dfs]](/img/57/ff494db248171253996dd6c9110715.png)
The number of incremental paths in the grid graph [dfs reverse path + memory dfs]

PHP MySQL create database

English grammar_ Noun classification

Prototype inheritance..
随机推荐
How to expand the capacity of golang slice slice
The gbase 8A database does not support the DB2 function value (column_name, 0) cluster syntax
Module 9 operation
[combinatorics] generating function (shift property)
Class exercises
BFS - topology sort
Five problems of database operation in commodity supermarket system
[Tongxin UOS] scanner device management driver installation
SQL injection -day16
一入“远程”终不悔,几人欢喜几人愁。| 社区征文
Website with JS doesn't work in IE9 until the Developer Tools is activated
毕业总结
Lesson 13 of the Blue Bridge Cup -- tree array and line segment tree [exercise]
Mature port AI ceaspectus leads the world in the application of AI in terminals, CIMC Feitong advanced products go global, smart terminals, intelligent ports, intelligent terminals
Computer graduation design PHP makeup sales Beauty shopping mall
[tutorial] build your first application on coreos
企业级自定义表单引擎解决方案(十二)--表单规则引擎2
Applet with multiple tabs and Swipers + paging of each tab
Bloom filter [proposed by bloom in 1970; redis cache penetration solution]
[教程]在 CoreOS 上构建你的第一个应用