Docs (4.0.0)
class ManagedList method

splice

Removes the specified object and following objects, and inserts the provided objects in their place.

splice(target?: T, removeCount?: number, ...objects: T[]): T[]

Notes

  • If the removeCount argument isn’t provided, all objects after the specified object are removed from the list.
  • If the removeCount argument is zero, new objects are inserted after the specified target object.
  • If the target isn’t found in the list, new objects are inserted at the end of the list.

Parameters

  • target — The first object to remove
  • removeCount — The number of objects to remove
  • objects — The objects to insert into the list

Return value

An array containing the objects that were removed

Related