Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### flatten
|
||||
---
|
||||
title: flatten
|
||||
tags: array,intermediate
|
||||
---
|
||||
|
||||
Flattens an array up to the specified depth.
|
||||
|
||||
@ -15,4 +18,4 @@ const flatten = (arr, depth = 1) =>
|
||||
```js
|
||||
flatten([1, [2], 3, 4]); // [1, 2, 3, 4]
|
||||
flatten([1, [2, [3, [4, 5], 6], 7], 8], 2); // [1, 2, 3, [4, 5], 6, 7, 8]
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user