Documentation

replace()

Replaces the specified item with another object in-place.

replace(item: T, replacement: T): this;

Parameters

Errors

This method throws an error if the item isn’t in the list, or if the replacement object is already in the list.

Related