rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
74 lines (35 loc) • 984 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [arrayRemoveOne](./rc-js-util.arrayremoveone.md)
## arrayRemoveOne() function
Removes either 0 or one item from items, even if itemToRemove appears more than once.
**Signature:**
```typescript
export declare function arrayRemoveOne<TItem>(items: TItem[], itemToRemove: TItem): boolean;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
items
</td><td>
TItem\[\]
</td><td>
</td></tr>
<tr><td>
itemToRemove
</td><td>
TItem
</td><td>
</td></tr>
</tbody></table>
**Returns:**
boolean
true if an item was removed.
## Remarks
The lowest indexed item will be removed where there is more than one match.
See [arrayRemoveOne()](./rc-js-util.arrayremoveone.md)<!-- -->.