hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
72 lines (34 loc) • 915 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [TickAllocator](./server.tickallocator.md) > [map](./server.tickallocator.map.md)
## TickAllocator.map() method
Maps an array to a new array using a callback function.
**Signature:**
```typescript
map<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U): U[];
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
array
</td><td>
T\[\]
</td><td>
The array to map.
</td></tr>
<tr><td>
callback
</td><td>
(value: T, index: number, array: T\[\]) => U
</td><td>
The callback function to map the array.
</td></tr>
</tbody></table>
**Returns:**
U\[\]
A new array with the mapped values.