From 1d556be8a7e396608639b7263f7ad4b7a5054fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A5=E6=AC=A7=E5=B7=B4?= <349247397@qq.com> Date: Wed, 23 Dec 2020 00:04:15 +0800 Subject: [PATCH] Update promise.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这里也需要同步下,阮大。 --- docs/promise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/promise.md b/docs/promise.md index c3eee39..02c1d06 100644 --- a/docs/promise.md +++ b/docs/promise.md @@ -210,7 +210,7 @@ new Promise((resolve, reject) => { ## Promise.prototype.then() -Promise 实例具有`then`方法,也就是说,`then`方法是定义在原型对象`Promise.prototype`上的。它的作用是为 Promise 实例添加状态改变时的回调函数。前面说过,`then`方法的第一个参数是`resolved`状态的回调函数,第二个参数(可选)是`rejected`状态的回调函数。 +Promise 实例具有`then`方法,也就是说,`then`方法是定义在原型对象`Promise.prototype`上的。它的作用是为 Promise 实例添加状态改变时的回调函数。前面说过,`then`方法的第一个参数是`resolved`状态的回调函数,第二个参数是`rejected`状态的回调函数,它们都是可选的。 `then`方法返回的是一个新的`Promise`实例(注意,不是原来那个`Promise`实例)。因此可以采用链式写法,即`then`方法后面再调用另一个`then`方法。