Skip to content
Lists & Helpers arrayIndexOf

$arrayIndexOf — Index of the first item equal to a value (-1 when absent).

Index of the first item equal to a value (-1 when absent).

Syntax

$arrayIndexOf[array;value]

Parameters

  • array (text, required) — Name of the array.
  • value (text, required) — The value.

Return Value

  • string.

Usage

$arrayIndexOf[a;1] → "1"

Example

$sendMessage[$arrayIndexOf[a;1]]

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.