Skip to content

$arrayIndexOf

$arrayIndexOf will return the index of the first found item of the query.

Usage

$arrayIndexOf[name;query]

Parameters

FieldTypeDescriptionRequired
namestringArray name.true
querystringThe element we will be queering for every element inside the array.true

Example(s)

1
client.command({
2
name: "arrayIndexOf",
3
code: `
4
$arrayIndexOf[array;akarui]
5
$createArray[array;aoi.js;akarui;documents;bot]
6
`
7
// It will return "2" as the word "akarui" is in the 2nd position of the array.
8
});