当前位置:网站首页>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
边栏推荐
- PUT vs. POST for Uploading Files - RESTful API to be Built Using Zend Framework
- SDNUOJ1015
- [combinatorics] generating function (summation property)
- Classroom attendance system based on face recognition tkinter+openpyxl+face_ recognition
- Should I be laid off at the age of 40? IBM is suspected of age discrimination, calling its old employees "dinosaurs" and planning to dismiss, but the employees can't refute it
- 聊聊支付流程的设计与实现逻辑
- SQL injection -day16
- Applet with multiple tabs and Swipers + paging of each tab
- 一入“远程”终不悔,几人欢喜几人愁。| 社区征文
- 【统信UOS】扫描仪设备管理驱动安装
猜你喜欢

Embedded-c language-7

Sensor 调试流程

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

基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition

As soon as we enter "remote", we will never regret, and several people will be happy and several people will be sad| Community essay solicitation

How to install PHP on Ubuntu 20.04

Win32: dump file analysis of heap corruption

PHP MySQL inserts multiple pieces of data

Draw some simple graphics with MFC

Redis core technology and practice - learning notes (11): why not just string
随机推荐
Getting started with deops
Inheritance of ES6 class
Fedora 21 installs lamp host server
Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028
Redis core technology and practice - learning notes (VIII) sentinel cluster: sentinel hung up
How to install PHP on Ubuntu 20.04
Should I be laid off at the age of 40? IBM is suspected of age discrimination, calling its old employees "dinosaurs" and planning to dismiss, but the employees can't refute it
OpenSSL的SSL/BIO_get_fd
On Data Mining
[combinatorics] generating function (use generating function to solve the combination number of multiple sets R)
win32:堆破坏的dump文件分析
An academic paper sharing and approval system based on PHP for computer graduation design
Use of unsafe class
Talk about the design and implementation logic of payment process
Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
Redis core technology and practice - learning notes (11): why not just string
Grammaire anglaise Nom - Classification
[combinatorics] generating function (property summary | important generating function)*
PHP MySQL where clause
MinGW compile boost library