---
name: "findAny"
type: command
status: ok
groups: ["Arrays"]
arma3_since: "2.10"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/findAny
revid: 377163
updated: 2026-01-01T10:41:43Z
---

# findAny

*Command · Arrays · Arma 3 v2.10*

## Description

Returns the zero-based index of the first element in array A that also exists in array B. If no common elements exist it returns -1.

Similar in functionality as [find's first syntax](../commands/find.md#syntax-1), but the second parameter is an array of elements to find.

## Syntax

```sqf
searchIn findAny toFind
```

**Parameters:**

- `searchIn`: [Array](../topics/Array.md) of [Anything](../topics/Anything.md)
- `toFind`: [Array](../topics/Array.md) of [Anything](../topics/Anything.md)

**Returns:** [Number](../topics/Number.md) - the index of the first found item

## Examples

### Example 1

```sqf
[0,1,2,3,4] findAny [2,4,6,8]; // returns 2
```

### Example 2

```sqf
[0,1,2,3,4] findAny [8,6,4,2]; // returns 2
```

### Example 3

```sqf
[0,1,2,3,4] findAny [5,7,9]; // returns -1
```

## See also

[find](../commands/find.md) · [findIf](../commands/findIf.md)

<sub>Source: [BI Community Wiki — findAny](https://community.bistudio.com/wiki/findAny) (revision 377163).</sub>
