From 4358adfa4d52e16f623a7d4ecaba38691251d85b Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 1 Feb 2018 17:23:17 +0000 Subject: [PATCH] Fixed chainAsync() skipping the first function in the array. --- snippets/chainAsync.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/chainAsync.md b/snippets/chainAsync.md index 1833eb4ad..f179ff4f8 100644 --- a/snippets/chainAsync.md +++ b/snippets/chainAsync.md @@ -9,7 +9,7 @@ The tenerary function checks the next function exists before calling it, otherwi ```js const chainAsync = fns => { let curr = 0; - const next = () => (fns[++curr] ? fns[curr](next) : false); + const next = () => (fns[curr] ? fns[curr++](next) : false); next(); }; ```