# GetEnumerator()

> Returns an enumerator over the key-value pairs of this hash map.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public readonly NativeHashMap<TKey, TValue>.Enumerator GetEnumerator()
```

### Returns

| Type                                                                                         | Description                                              |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [Enumerator](/engine/6000.7/script-reference/unity/collections/nativehashmap2/enumerator.md) | An enumerator over the key-value pairs of this hash map. |
