* Create a new array with the results of calling a function for each entry in the collection
(
callbackfn: (value: TOutput, key: TKey, index: number) => U,
)
| 453 | * Create a new array with the results of calling a function for each entry in the collection |
| 454 | */ |
| 455 | public map<U>( |
| 456 | callbackfn: (value: TOutput, key: TKey, index: number) => U, |
| 457 | ): Array<U> { |
| 458 | const result: Array<U> = [] |
| 459 | let index = 0 |
| 460 | for (const [key, value] of this.entries()) { |
| 461 | result.push(callbackfn(value, key, index++)) |
| 462 | } |
| 463 | return result |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * Check if the given collection is this collection |