# arrayIndexOf

Returns the index of a value inside an array.

The index is zero based, and if a value is not present in the array, it results in -1.

## Arguments

1. Array to use.
2. Value to use.

## Examples

| Expression | Result |
| --- | --- |
| WITH $names = [ 'John Doe', 'Tom Cruise', 'David Bowie',null] SELECT { a<br>= arrayIndexOf($names, 'Tom Cruise'), b = arrayIndexOf($names, null), c =<br>arrayIndexOf($names, 'David Bowie') } | {"a": 1, "b": 3, "c": 2} |