| 29 | } |
| 30 | |
| 31 | class GroupIterator { |
| 32 | #members; |
| 33 | #position; |
| 34 | |
| 35 | constructor(members) { |
| 36 | this.#members = members; |
| 37 | this.#position = 0; |
| 38 | } |
| 39 | |
| 40 | next() { |
| 41 | if (this.#position >= this.#members.length) { |
| 42 | return {done: true}; |
| 43 | } else { |
| 44 | let result = {value: this.#members[this.#position], |
| 45 | done: false}; |
| 46 | this.#position++; |
| 47 | return result; |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | for (let value of Group.from(["a", "b", "c"])) { |
| 53 | console.log(value); |
nothing calls this directly
no outgoing calls
no test coverage detected