(
callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void,
thisArg?: any
)
| 131 | } |
| 132 | |
| 133 | forEach( |
| 134 | callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, |
| 135 | thisArg?: any |
| 136 | ): void { |
| 137 | const state = this._state; |
| 138 | let current = this._head; |
| 139 | while (current) { |
| 140 | if (thisArg) { |
| 141 | callbackfn.bind(thisArg)(current.value, current.key, this); |
| 142 | } else { |
| 143 | callbackfn(current.value, current.key, this); |
| 144 | } |
| 145 | if (this._state !== state) { |
| 146 | throw new Error(`LinkedMap got modified during iteration.`); |
| 147 | } |
| 148 | current = current.next; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | keys(): IterableIterator<K> { |
| 153 | const map = this; |
no outgoing calls