# Module: flatten

## Table of contents

### Functions

- [default](flatten.md#default)

## Functions

### default

▸ **default**(`collection`, `depth?`): `any`[]

Creates an array with all nested collections concatenated recursively into one layer.

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `collection` | `Collection` | `undefined` |
| `depth` | `number` | `Infinity` |

#### Returns

`any`[]

#### Defined in

[src/flatten.js:18](https://github.com/Twipped/js-utils/blob/9c196e3/src/flatten.js#L18)
