嵌套回调 & Promise & generator 异步方法的对比

1、回调函数方式

 

 

 2、promise 方式

 

 

3、generator方式

 

 

 

 

4、对比ajax,  promise 和 generator 的应用场景

 

 

(一) 

(二) 

 

 

 

(三) 

 

 

 

 

posted @ 2020-07-15 14:05  CatherLee  阅读(138)  评论(0编辑  收藏  举报