Summary
Finds if an array contains an element.
Description
Determines whether an array includes a certain element, returning true or false as appropriate.
Route
No Northbound API Available
Roles
Parameters
DetailsExampleSchema
| Name |
Type |
Required |
Description |
| arr |
array |
yes |
The array to search |
| searchElement |
* |
yes |
The element to search for |
| fromIndex |
number |
no |
The position in the array to begin searching for searchElement |
Copied to Clipboard
{
"arr": [
"elit aliqua officia"
],
"searchElement": "Device3",
"fromIndex": 1
}
Copied to Clipboard
{
"type": "object",
"properties": {
"arr": {
"title": "arr",
"type": "array",
"items": [
{
"type": [
"string",
"number",
"integer",
"object",
"array",
"boolean",
"null"
]
}
]
},
"searchElement": {
"type": [
"array",
"string",
"boolean",
"integer",
"number",
"object"
],
"title": "searchElement",
"examples": [
"Device3"
]
},
"fromIndex": {
"title": "fromIndex",
"type": "integer",
"examples": [
1
]
}
},
"required": [
"arr",
"searchElement"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
| Name |
Type |
Description |
| result |
boolean |
True if the value searchElement is found within the array; false otherwise |
Copied to Clipboard
false
Copied to Clipboard
{
"title": "result",
"type": "boolean",
"examples": [
false
]
}