# Initialize

Creates a collection by calling the given `initializer` on each index.

> &#x20;**WARNING**&#x20;
>
> This method isn't available as an extension method.

| Parameters                                            | Returns         |
| ----------------------------------------------------- | --------------- |
| <p>int length</p><p>Func&#x3C;int, T> initializer</p> | IEnumerable\<T> |

## Usage

&#x20;**Creating an integer collection**&#x20;

```csharp
IEnumerable<int> result = 
    CollectionModule.Initialize(5, index => index * 2);

//result = { 0, 2, 4, 6, 8 }
```
