# ToArray<T>(UnsafeParallelHashSet<T>)

> Returns a new managed array with all the elements copied from a set.

## Definition

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

```csharp
public static T[] ToArray<T>(this UnsafeParallelHashSet<T> set) where T : unmanaged, IEquatable<T>
```

### Parameters

**** (\[UnsafeParallelHashSet\<T>]\(/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeparallelhashset1)): The set whose elements are copied to the array.

### Returns

| Type              | Description                                                  |
| ----------------- | ------------------------------------------------------------ |
| [\<T>\[\]](./.md) | A new managed array with all the elements copied from a set. |
