async与await的区别
时间: 2023-10-13 15:04:38 浏览: 50
async是一个关键字,用于声明一个函数是异步函数。而await也是一个关键字,用于等待一个异步任务执行完成的结果。async/await是一种编写异步代码的新方法,相比传统的回调和Promise,它建立在Promise的基础上,并且让异步代码看起来、表现起来更像同步代码。async/await的使用能够让我们以一种更直观、更简洁的方式来处理异步操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [什么是async,什么是await,async和await的区别,async和await的理解](https://blog.csdn.net/come_and_play/article/details/131464818)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [async和await的区别](https://blog.csdn.net/dtfygewr/article/details/127666003)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文