Skip to content

Files

Latest commit

0d1b4ea · Jun 4, 2020

History

History
16 lines (8 loc) · 374 Bytes

n-2.md

File metadata and controls

16 lines (8 loc) · 374 Bytes

如何避免回调地狱?

?> 模块化: 将回调函数转换为独立的函数

?> 使用流程控制库,例如aync

?> 使用Promise

?> 使用aync/await

等等...,有很多答案,取决于使用场景

参考资料:

Async/Await替代Promise的6个理由