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.
72 lines (34 loc) • 973 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [arrayMap](./rc-js-util.arraymap.md)
## arrayMap() function
Like `Array.map`<!-- -->.
**Signature:**
```typescript
export declare function arrayMap<TItem, TMapped>(items: ArrayLike<TItem>, callback: (item: TItem, index: number) => TMapped): TMapped[];
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
items
</td><td>
ArrayLike<TItem>
</td><td>
</td></tr>
<tr><td>
callback
</td><td>
(item: TItem, index: number) => TMapped
</td><td>
</td></tr>
</tbody></table>
**Returns:**
TMapped\[\]
## Remarks
Has more consistent performance characteristics cross platform than the built in `Array.map`
See [arrayMap()](./rc-js-util.arraymap.md)<!-- -->.