From b32cee1f38ad0a2e0f7313383061c8c01f96894f Mon Sep 17 00:00:00 2001 From: Hawtim Zhang Date: Thu, 5 Nov 2020 15:44:50 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E6=A8=A1=E6=8B=9F=E5=AE=9E=E7=8E=B0pr?= =?UTF-8?q?omise.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: typos --- ...6\250\241\346\213\237\345\256\236\347\216\260promise.md" | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git "a/JavaScript/\346\250\241\346\213\237\345\256\236\347\216\260promise.md" "b/JavaScript/\346\250\241\346\213\237\345\256\236\347\216\260promise.md" index 5210414..32637d5 100644 --- "a/JavaScript/\346\250\241\346\213\237\345\256\236\347\216\260promise.md" +++ "b/JavaScript/\346\250\241\346\213\237\345\256\236\347\216\260promise.md" @@ -264,7 +264,7 @@ MyPromise.prototype.finally = function(fn) { `Promise.resolve`用来生成一个直接处于`FULFILLED`状态的Promise。 ```js -MyPromise.reject = function(value) { +MyPromise.resolve = function(value) { return new MyPromise((resolve, reject) => { resolve(value); }); @@ -290,7 +290,7 @@ MyPromise.reject = function(reason) { ```js MyPromise.all = function (promises) { - return new Promise((resolve, reject) => { + return new MyPromise((resolve, reject) => { if (promises.length === 0) { resolve([]); } else { @@ -320,7 +320,7 @@ MyPromise.reject = function(reason) { ```js MyPromise.race = function (promises) { - return new Promise((resolve, reject) => { + return new MyPromise((resolve, reject) => { if (promises.length === 0) { resolve(); } else {