* Maps the collection items based on your provided mapper function.
(mapper: (item: T, index: number) => R)
| 796 | * Maps the collection items based on your provided mapper function. |
| 797 | */ |
| 798 | map<R>(mapper: (item: T, index: number) => R): R[] { |
| 799 | this.checkInitialized(); |
| 800 | const items: R[] = []; |
| 801 | let index = 0; |
| 802 | |
| 803 | for (const item of this.#items) { |
| 804 | items.push(mapper(item, index++)); |
| 805 | } |
| 806 | |
| 807 | return items; |
| 808 | } |
| 809 | |
| 810 | /** |
| 811 | * Maps the collection items based on your provided mapper function to a single object. |
no test coverage detected