赞
踩
直接贴代码了,自己去打印看效果就会懂
- async function async1() {
- console.log(1);
- const result = await async2();
- async3()
- }
- async function async2() {
- return new Promise((resolve, reject) => {
- setTimeout(() => {
- resolve(2)
- console.log(2)
- }, 2000);
- })
- }
- function async3() {
- console.log(3)
- }
- async1();
喜欢上方小程序,需要源码的,私信小编留下邮箱。
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。