Skip to content
Lists & Helpers arrayFilter

$arrayFilter — Keeps the items for which a condition is true.

Keeps the items for which a condition is true.

Syntax

$arrayFilter[array;variable;condition;(other)]

Parameters

  • array (text, required) — Name of the array.
  • variable (text, required) — Local variable that holds the item.
  • condition (code, required) — Condition run for each item.
  • other (text, optional) — Array that receives the result.

Return Value

  • string.

Usage

$arrayFilter[a;x;$env[x]>1]

Example

$sendMessage[$arrayFilter[a;x;$env[x]>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.