@includes
Check whether an array contains an element.
Returns: bool
Syntax
Section titled “Syntax”@includes(value item)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value |
array |
Input value |
item |
any |
Element to search for |
Examples
Section titled “Examples”# Check if array contains elementset $arr [1 2 3]print @includes($arr 2)
# Check for missing elementset $arr [1 2 3]print @includes($arr 99)