@lang:includes
Check whether an array contains an element.
On-chain (@lang:includes!): The element may be constant or live. Generic arrays compare canonical ABI values, preserving dynamic tuple and array boundaries.
Returns: bool
Syntax
Section titled “Syntax”@lang:includes(value item)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value | array | Source array |
item | any | Element to search for |
See Also
Section titled “See Also”On-chain face (@includes!)
Section titled “On-chain face (@includes!)”Test membership of a typed array, supporting single-word and multiword elements. Generic values use equality of their canonical ABI encodings. Search stops at the first match. Use @str.includes! for substring membership.