Skip to content

ReadOnlyObservableCollection.findLastIndex

github-actions[bot] edited this page Dec 3, 2024 · 3 revisions
API / ReadOnlyObservableCollection<TItem> / findLastIndex method

Returns the index of the last item that satisfies the given condition.

public findLastIndex<TContext = void>(
  predicate: (this: TContext, item: TItem, index: number, collection: this) => boolean,
  thisArg?: TContext
): number

Source reference: src/collections/observableCollections/ReadOnlyObservableCollection.ts:597.

Generic Parameters

  • TContext - The context type in which the callback is executed.

    Default value: void.

Parameters

  • 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 last item for which the provided predicate evaluates to true; otherwise -1.

See also

Clone this wiki locally