> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# arrayIncludes

> Use the arrayIncludes task to determine whether an array contains a given element.

The `arrayIncludes` task determines whether an array includes a given element and returns `true` or `false` as appropriate. When used with a `fromIndex` value, you can specify where in the array the search should begin.

## Potential use case

Suppose you have a list of email addresses and want to check whether a certain address is in that list. Specify the address you're looking for — if it is present, the result is `true`; if not found, the result is `false`.

## Properties

| Incoming        | Type   | Description                                                                                 |
| :-------------- | :----- | :------------------------------------------------------------------------------------------ |
| `arr`           | Array  | Required. The array to search.                                                              |
| `searchElement` | Any    | Required. The element to search for.                                                        |
| `fromIndex`     | Number | Optional. The position in the array to begin searching for `searchElement`. Default is `0`. |

| Outgoing | Type    | Description                                                                 |
| :------- | :------ | :-------------------------------------------------------------------------- |
| `result` | Boolean | `true` if the `searchElement` is found within the array; `false` otherwise. |

## Example

In this example:

* The array is statically set to `["1","2","3"]`.
* The `searchElement` to find is the number `2`.
* The `fromIndex` defaults to `0`.
* The `result` is `true` because `2` is present in the array.

![](/_fern-img/6078a1d23aadca3b0789800455ebd009e3a24c4e178d47f6b18d85196d5244f5.webp)