MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / next

Method next

code/solutions/06_3_iterable_groups.js:40–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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
52for (let value of Group.from(["a", "b", "c"])) {

Callers 2

measurePrimesFunction · 0.45
measurePrimesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected