@serenity-is/corelib / indexOf

Function: indexOf()

indexOf<TItem>(array, predicate): number

Defined in: src/compat/arrays-compat.ts:103

Gets index of first element in an array that matches given predicate.

Type Parameters

TItem

TItem

Parameters

array

TItem[]

Array to test.

predicate

(x) => boolean

Predicate to test elements.

Returns

number