docs(promise): fix #1028

This commit is contained in:
ruanyf
2020-12-22 23:41:42 +08:00
parent e640ce7189
commit 843c6521f5

View File

@@ -52,7 +52,7 @@ promise.then(function(value) {
});
```
`then`方法可以接受两个回调函数作为参数。第一个回调函数是`Promise`对象的状态变为`resolved`时调用,第二个回调函数是`Promise`对象的状态变为`rejected`时调用。其中,第二个函数是可选的,不一定要提供。这两个函数都接受`Promise`对象传出的值作为参数。
`then`方法可以接受两个回调函数作为参数。第一个回调函数是`Promise`对象的状态变为`resolved`时调用,第二个回调函数是`Promise`对象的状态变为`rejected`时调用。这两个函数是可选的,不一定要提供。它们都接受`Promise`对象传出的值作为参数。
下面是一个`Promise`对象的简单例子。