Async Await

本文参考自:https://www.cnblogs.com/YMaster/p/6920441.html

async/await 规则:

  1. async 表示这是一个 async 函数,而 await 只能在这个函数里面使用。

  2. await 表示在这里等待 await 后面的操作执行完毕,再执行下一句代码。

  3. await 后面紧跟着的最好是一个耗时的操作或者是一个异步操作。

猜你喜欢

转载自www.cnblogs.com/mengfangui/p/8906752.html