Skip to content

ReadOnlyObservableCollection.findLastIndex

Andrei Fangli edited this page Sep 3, 2023 · 2 revisions
API / ReadOnlyObservableCollection<TItem> / findLastIndex method

Returns the index of the last item for which the provided predicate evaluated to true, if no item can be found then -1 is returned.

This is a public method.

public findLastIndex(predicate: (item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => boolean): number

Parameters

  • predicate: Function, the callback performing the item check.

    Parameters:

    Returns: Boolean

    Returns true if the provided item satisfies the condition; false otherwise.

Returns: Number

Returns the index of the last item for which the provided predicate evaluates to true; otherwise -1.

See


Returns the index of the last item for which the provided predicate evaluated to true, if no item can be found then -1 is returned.

This is a public method.

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

Template Parameters

  • TContext: the context type in which the callback is executed.

Parameters

  • predicate: Function, the callback performing the item check.

    Parameters:

    Returns: Boolean

    Returns true if the provided item satisfies the condition; false otherwise.
  • thisArg: TContext, a value to use as context when checking items.

Returns: Number

Returns the index of the last item for which the provided predicate evaluates to true; otherwise -1.

See

Clone this wiki locally