Home > rc-js-util > arrayReplaceOne
Replaces the first match of itemToRemove with replaceWith.
Signature:
export declare function arrayReplaceOne<TItem>(items: TItem[], itemToRemove: TItem, replaceWith: TItem): boolean;
| Parameter | Type | Description |
|---|---|---|
| items | TItem[] | |
| itemToRemove | TItem | |
| replaceWith | TItem |
Returns:
boolean
true if an element was replaced.
See arrayReplaceOne().