update snippets 62-78
This commit is contained in:
committed by
Agamemnon Zorbas
parent
32fa5a9773
commit
d0a8c3b238
@ -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]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user