Fix end inclusive error

This commit is contained in:
David Wu
2018-01-03 12:42:11 +01:00
committed by GitHub
parent c137dd5277
commit 3c4b21ca0f

View File

@ -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 + 2 - start - step)/step)}).map((v, i) => (i * step) + start);
Array.from({length:Math.ceil((end + 1 - start)/step)}).map((v, i) => (i * step) + start);
```
```js