Apply new format to snippets and template

This commit is contained in:
Angelos Chalaris
2020-09-15 16:28:04 +03:00
parent 040efd4380
commit 53c16dbf65
401 changed files with 969 additions and 950 deletions

View File

@ -5,8 +5,8 @@ tags: array,math,intermediate
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 `val` to use a default value of `0`.
- Use `Array(n)` to create an array of the desired length, `fill(v)` to fill it with the desired values.
- You can omit `val` to use a default value of `0`.
```js
const initializeArrayWithValues = (n, val = 0) => Array(n).fill(val);
@ -14,4 +14,4 @@ const initializeArrayWithValues = (n, val = 0) => Array(n).fill(val);
```js
initializeArrayWithValues(5, 2); // [2, 2, 2, 2, 2]
```
```