replaceAt()
Removes the specified object and following objects, and inserts the provided objects in their place.
replaceAt(item?: T, removeCount?: number, ...insert: T[]): T[];
Notes
- If the
removeCountargument isn’t provided, all objects after the specified object are removed from the list. - If the
removeCountargument is zero, new objects are inserted after the specified item. - If the item isn’t found in the list, new objects are inserted at the end of the list.
Parameters
- item — The first object to remove
- removeCount — The number of objects to remove
- insert — The objects to insert into the list
Return value
An array containing the objects that were removed
Related
class ObservableList
A data structure that contains an ordered set of observable objects.
