---
name: "BIS_fnc_randomIndex"
type: function
status: ok
groups: ["Arrays"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_randomIndex
revid: 327174
updated: 2022-07-12T22:07:07Z
---

# BIS_fnc_randomIndex

*Function · Arrays · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Return a random integer representing an index in the passed array.

## Syntax

```sqf
array call BIS_fnc_randomIndex
```

**Parameters:**

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

**Returns:** [Number](../topics/Number.md)

## Examples

### Example 1

```sqf
["a", 0, objNull] call BIS_fnc_randomIndex; // returns 0, 1 or 2
```

## See also

[floor](../commands/floor.md) · [count](../commands/count.md) · [random](../commands/random.md) · [selectRandom](../commands/selectRandom.md)

<sub>Source: [BI Community Wiki — BIS fnc randomIndex](https://community.bistudio.com/wiki/BIS_fnc_randomIndex) (revision 327174).</sub>
