From 34f0f2a9a3ae4135028efb15e973a63539bbe4a6 Mon Sep 17 00:00:00 2001 From: King Date: Thu, 21 Dec 2017 07:26:40 -0500 Subject: [PATCH] ran npm run builder --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d48327a92..2aabd659e 100644 --- a/README.md +++ b/README.md @@ -1242,7 +1242,7 @@ Use `Array.reduce()` to add values into the array, using the sum of the last two ```js const fibonacci = n => - Array(n).fill(0).reduce((acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), []); + Array.from({ length: n}).map(v => 0).reduce((acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), []); // fibonacci(5) -> [0,1,1,2,3] ```