Archive, multitagging, cleanup
Cleaned up the current snippets for consistency and minor problems, added multiple tags to most of them, archived a few.
This commit is contained in:
@ -3,10 +3,10 @@
|
||||
Initializes and fills an array with the specified values.
|
||||
|
||||
Use `Array(n)` to create an array of the desired length, `fill(v)` to fill it with the desired values.
|
||||
You can omit `value` to use a default value of `0`.
|
||||
You can omit `val` to use a default value of `0`.
|
||||
|
||||
```js
|
||||
const initializeArrayWithValues = (n, value = 0) => Array(n).fill(value);
|
||||
const initializeArrayWithValues = (n, val = 0) => Array(n).fill(val);
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user