Change all snippets from var to const
This commit is contained in:
@ -4,6 +4,6 @@ Use recursion.
|
||||
Use `reduce()` to get all elements that are not arrays, flatten each element that is an array.
|
||||
|
||||
```js
|
||||
var flatten = arr =>
|
||||
const flatten = arr =>
|
||||
arr.reduce( (a, v) => a.concat( Array.isArray(v) ? flatten(v) : v ), []);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user