# IndexOf<T>(T[], T)

> Index of first element with value value.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## IndexOf\<T>(\`\<>\[], T)

```csharp
public static int IndexOf<T>(T[] array, T value)
```

### Parameters

**** (\[\<T>\[]]\(./)): **** (T):&#x20;

### Returns

| Type                                                       | Description                                                  |
| ---------------------------------------------------------- | ------------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the element, if found; otherwise -1. |
