Skip to content

ObservableCollection.splice

github-actions[bot] edited this page Nov 17, 2024 · 2 revisions
API / ObservableCollection<TItem> / splice method

This method overrides ReadOnlyObservableCollection.splice.

Removes and/or adds elements to the collection and returns the deleted elements.

public splice(
  start: number,
  deleteCount?: number,
  ...items: readonly TItem[]
): TItem[]

Source reference: src/collections/observableCollections/ObservableCollection.ts:100.

Parameters

  • start: number
    The zero-based location in the collection from which to start removing elements.

  • deleteCount: number
    The number of elements to remove.

  • items (rest): readonly TItem[]
    The items to insert at the given start location.

Returns: TItem[]

An array containing the elements that were deleted.

See also

Clone this wiki locally