hym1224 / js

0 stars 0 forks source link

Async/Await #6

Open hym1224 opened 6 years ago

hym1224 commented 6 years ago

from http://mp.weixin.qq.com/s/5ir6N17XHPRtQ_kQm8ZV0A

hym1224 commented 6 years ago

tips 怎样容错呢,犹豫await后面的promise运行结果可能是rejected,最好把await放入try{}catch{}中 Await后的异步操作,如果彼此没有依赖关系最好同时触发,在下面场景一会有介绍 Await只能在async函数之中,如果在普通函数中,会报错