Added samples
This commit is contained in:
@ -4,6 +4,6 @@ Use `Array(n)` to create an array of the desired length, `fill(v)` to fill it wi
|
||||
You can omit `v` to use a default value of `0`.
|
||||
|
||||
```js
|
||||
const initializeArray = (n, v = 0) =>
|
||||
Array(n).fill(v);
|
||||
const initializeArray = (n, v = 0) => Array(n).fill(v);
|
||||
// initializeArray(5, 2) -> [2,2,2,2,2]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user