indexOf
number indexOf(container, value, startIndex)
Returns the index where value is found in container.
- An array container is searched for an element which equals value.
- A text container is searched for an subsection that match value (case-sensitive).
Parameters
- container — array or text to search for value.
- value — array element or text subsection to search for.
- startIndex — optional index in container where to start searching. 0 if omitted.
Returns
- index (≥ 0) in container where the value is found, -1 otherwise.