# Equals

> Compares two NativeArray<T> instances.

## Definition

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

## Equals(NativeArray\<T>)

Compares two [NativeArray\<T>](/engine/6000.6/script-reference/unity/collections/nativearray1.md) instances.

```csharp
public bool Equals(NativeArray<T> other)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): The NativeArray to compare against.

### Returns

| Type                                                          | Description                                                          |
| ------------------------------------------------------------- | -------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the two NativeArray instances are the same, false otherwise. |

### Remarks

Two [NativeArray\<T>](/engine/6000.6/script-reference/unity/collections/nativearray1.md) instances are considered the same if they point to the same underlying memory buffer, and have the same length.

## Equals(Object)

Compares a [NativeArray\<T>](/engine/6000.6/script-reference/unity/collections/nativearray1.md) instance and an object.

```csharp
public override bool Equals(object obj)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The object to compare against.

### Returns

| Type                                                          | Description                                                           |
| ------------------------------------------------------------- | --------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the NativeArray and the object are the same, false otherwise. |

### Remarks

A NativeArray and an object are considered the same if they point to the same underlying memory buffer, and have the same length.
