update snippets 62-78

This commit is contained in:
Stefan Feješ
2017-12-25 14:23:06 +01:00
committed by Agamemnon Zorbas
parent 32fa5a9773
commit d0a8c3b238
16 changed files with 81 additions and 36 deletions

View File

@ -8,6 +8,9 @@ You can omit `start` to use a default value of `0`.
```js
const initializeArrayWithRange = (end, start = 0) =>
Array.from({ length: (end + 1) - start }).map((v, i) => i + start);
// initializeArrayWithRange(5) -> [0,1,2,3,4,5]
// initializeArrayWithRange(7, 3) -> [3,4,5,6,7]
```
```js
initializeArrayWithRange(5) -> [0,1,2,3,4,5]
initializeArrayWithRange(7, 3) -> [3,4,5,6,7]
```