insert
Inserts the provided object into the list, before the specified reference object.
insert(target: T, before?: T): this
Notes
- If no
before
argument is specified, the target object is added to the end of the list.
Parameters
- target — The object to insert
- before — The reference object, before which to insert the target object
Errors
- This method throws an error if the target object is already in the list.
- This method throws an error if the target object isn’t of the correct type (see restrict()).
- This method throws an error if the reference object isn’t in the list.
Related
- class ManagedListA data structure that contains an ordered set of managed objects.