# ToArray()

> Convert the data in a NativeArray<T>.ReadOnly to a managed array.

## Definition

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

```csharp
public T[] ToArray()
```

### Returns

| Type              | Description                                                                                                                                                     |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [\<T>\[\]](./.md) | A new managed array with the same contents as the given [NativeArray\<T>.ReadOnly](/engine/6000.5/script-reference/unity/collections/nativearray1/readonly.md). |
