From 1cb12e7db1b85151013ddd50b20c9718b9e498de Mon Sep 17 00:00:00 2001 From: Rohit Tanwar <31792358+kriadmin@users.noreply.github.com> Date: Wed, 3 Jan 2018 14:38:42 +0530 Subject: [PATCH] Update initializeArrayWithRange.md --- snippets/initializeArrayWithRange.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/initializeArrayWithRange.md b/snippets/initializeArrayWithRange.md index 2b3c323a1..38945c1b3 100644 --- a/snippets/initializeArrayWithRange.md +++ b/snippets/initializeArrayWithRange.md @@ -8,7 +8,7 @@ You can omit `step` to use a default value of `1`. ```js const initializeArrayWithRange = (end, start = 0,step = 1) => - Array.from({length:Math.ceil((end + 1 - start)/2))}).map((v, i) => (i * step) + start); + Array.from({length:Math.ceil((end + 2 - start - step)/step)}).map((v, i) => (i * step) + start); ``` ```js