From c43225319371a27984822c4038404d5292507378 Mon Sep 17 00:00:00 2001 From: Jacty Date: Sun, 13 Sep 2020 01:11:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=20async=20=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=86=85=E9=83=A8=E6=8A=A5=E9=94=99=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=20Promise=20=E5=AF=B9=E8=B1=A1=E5=8F=98=E4=B8=BA`reje?= =?UTF-8?q?ct`=E7=8A=B6=E6=80=81=E7=9A=84=E4=BE=8B=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原来的例子并不能很明显的表示打印的内容来自于 reject 的回调。 --- docs/async.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/async.md b/docs/async.md index d109a39..1bb0dd7 100644 --- a/docs/async.md +++ b/docs/async.md @@ -184,10 +184,10 @@ async function f() { } f().then( - v => console.log(v), - e => console.log(e) + v => console.log(‘resolve’,v), + e => console.log('reject',e) ) -// Error: 出错了 +//reject Error: 出错了 ``` ### Promise 对象的状态变化