Update flatten-array.md
add closing bracket to the comment part
This commit is contained in:
@ -4,5 +4,5 @@ Use `reduce()` to get all elements inside the array and `concat()` to flatten th
|
||||
|
||||
```js
|
||||
const flatten = arr => arr.reduce( (a, v) => a.concat(v), []);
|
||||
// flatten([1,[2],3,4) -> [1,2,3,4]
|
||||
// flatten([1,[2],3,4]) -> [1,2,3,4]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user