Find Index
Module Info:
moduleType: "internal",
moduleName: "findIndex"
Description
The findIndex
function looks for an item inside an array and returns its index.
Inputs
Name | Type | Required |
---|---|---|
array | Array<any> | ✔ |
searchedItem | any | ✔ |
Outputs
Name | Type |
---|---|
result | number |
notFoundMessage | string |
notFoundMessage
will only be defined if the item is not found.
Examples
Inputs | Outputs | ||
---|---|---|---|
array | searchedItem | result | notFoundMessage |
[ "first", "second", "third" ] | "second" | 1 | undefined |
[ "first", "second", "third" ] | "third" | 2 | undefined |
[ "first", "second", "third" ] | "foo" | undefined | "No item matchs in the given array" |