* Create a new array with the results of calling a function for each entry in the collection
(
callbackfn: (
value: WithVirtualProps<TOutput, TKey>,
key: TKey,
index: number,
) => U,
)
| 555 | * Create a new array with the results of calling a function for each entry in the collection |
| 556 | */ |
| 557 | public map<U>( |
| 558 | callbackfn: ( |
| 559 | value: WithVirtualProps<TOutput, TKey>, |
| 560 | key: TKey, |
| 561 | index: number, |
| 562 | ) => U, |
| 563 | ): Array<U> { |
| 564 | const result: Array<U> = [] |
| 565 | let index = 0 |
| 566 | for (const [key, value] of this.entries()) { |
| 567 | result.push(callbackfn(value, key, index++)) |
| 568 | } |
| 569 | return result |
| 570 | } |
| 571 | |
| 572 | public getKeyFromItem(item: TOutput): TKey { |
| 573 | return this.config.getKey(item) |