From 7d83a1a271447f8919e8314695805faf9843f2e1 Mon Sep 17 00:00:00 2001 From: Dmitry <35150344+Senseinvader@users.noreply.github.com> Date: Sun, 17 Mar 2019 20:12:22 +0100 Subject: [PATCH] Update article.md --- 1-js/11-async/06-promisify/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/11-async/06-promisify/article.md b/1-js/11-async/06-promisify/article.md index 17e3dbd1..404b8af0 100644 --- a/1-js/11-async/06-promisify/article.md +++ b/1-js/11-async/06-promisify/article.md @@ -30,7 +30,7 @@ let loadScriptPromise = function(src) { return new Promise((resolve, reject) => { loadScript(src, (err, script) => { if (err) reject(err) - elsee resolve(script); + else resolve(script); }); }) } @@ -75,7 +75,7 @@ loadScriptPromise(...).then(...); Here we assume that the original function expects a callback with two arguments `(err, result)`. That's what we meet most often. Then our custom callbacks is exactly in the right format, and `promisify` works great for such case. -But what is the original `f` expects a callback with more arguments `callback(err, res1, res2)`? +But what if the original `f` expects a callback with more arguments `callback(err, res1, res2)`? Here's a modification of `promisify` that returns an array of multiple callback results: