Skip to content

ReadOnlyObservableCollection.map

Andrei Fangli edited this page Sep 3, 2023 · 2 revisions

Creates a new JavaScript Array constructed by mapping each item in the collection using a callback.

This is a public method.

public map<TResult>(callbackfn: (item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => TResult): TResult[]

Template Parameters

  • TResult: the type to map each item to.

Parameters

  • callbackfn: Function, the callback mapping each item.

    Parameters:

    Returns: TResult

    Returns the mapped item.

Returns: TResult[]

A new Array containing the mapped items.

See


Creates a new JavaScript Array constructed by mapping each item in the collection using a callback.

This is a public method.

public map<TResult, TContext>(callbackfn: (this: TContext, item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => TResult, thisArg: TContext): TResult[]

Template Parameters

  • TResult: the type to map each item to.
  • TContext: the context type in which the callback is executed.

Parameters

  • callbackfn: Function, the callback mapping each item.

    Parameters:

    Returns: TResult

    Returns the mapped item.
  • thisArg: TContext, a value to use as the callback context when mapping items.

Returns: TResult[]

A new Array containing the mapped items.

See

Clone this wiki locally