ReadOnlyObservableCollection.findIndex - Andrei15193/react-model-view-viewmodel GitHub Wiki
API / ReadOnlyObservableCollection<TItem> / findIndex method
Returns the index of the first item that satisfies the given condition.
public findIndex<TContext = void>(
predicate: (this: TContext, item: TItem, index: number, collection: this) => boolean,
thisArg?: TContext
): number
Source reference: src/collections/observableCollections/ReadOnlyObservableCollection.ts:572
.
-
TContext - The context type in which the callback is executed.
Default value:
void
.
-
predicate: (this:TContext, item:TItem, index:
number
, collection:this
) =>boolean
The callback performing the item check. -
thisArg: TContext
A value to use as context when evaluating items.
Returns: number
Returns the index of the first item for which the provided predicate
evaluates to true
; otherwise -1
.