Skip to content

@includes

Check whether an array contains an element.

Returns: bool

@includes(value item)
Name Type Description
value array Input value
item any Element to search for
# Check if array contains element
set $arr [1 2 3]
print @includes($arr 2)
# Check for missing element
set $arr [1 2 3]
print @includes($arr 99)
  • @find — find the first matching element
  • @filter — keep all matching elements