diff --git a/source/_posts/异步执行.md b/source/_posts/异步执行.md index df070fd..2bd00b4 100644 --- a/source/_posts/异步执行.md +++ b/source/_posts/异步执行.md @@ -75,4 +75,23 @@ setTimeout(function() { setTimeout(() => { ... }, 2000); +``` +# 比如:你出去吃披萨 +在餐馆,你遵循以下步骤: +- 请求菜单 +- 订一个披萨 +- 检查披萨 +- 吃披萨 +- 支付披萨 +在前一步完成之前,每一步都不能继续。 +```javascript +requestMenu(); +// twiddle thumbs +orderPizza(); +// twiddle thumbs +verifyPizza(); +// twiddle thumbs +eatPizza(); +// twiddle thumbs +payForPizza(); ``` \ No newline at end of file