Documentation

insert()

Inserts the provided object into the list, before the specified reference object.

insert(item: T, before?: T): this;

Notes

Parameters

Errors

This method throws an error if the item is already in the list. This method throws an error if the item isn’t of the correct type (see restrict()). This method throws an error if the reference object isn’t in the list.

Related