Lists & Helpers
arrayFindLastIndex
$arrayFindLastIndex — Index of the last item for which a condition is true (-1 if none).
Index of the last item for which a condition is true (-1 if none).
Syntax
$arrayFindLastIndex[array;variable;condition]
Parameters
- array (text, required) — Name of the array.
- variable (text, required) — Local variable that holds the item.
- condition (code, required) — Condition.
Return Value
- string.
Usage
$arrayFindLastIndex[a;x;$env[x]<3] → "2"
Example
$sendMessage[$arrayFindLastIndex[a;x;$env[x]<3]]
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.