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

Method from

code/solutions/06_3_iterable_groups.js:18–24  ·  view source on GitHub ↗
(collection)

Source from the content-addressed store, hash-verified

16 }
17
18 static from(collection) {
19 let group = new Group;
20 for (let value of collection) {
21 group.add(value);
22 }
23 return group;
24 }
25
26 [Symbol.iterator]() {
27 return new GroupIterator(this.#members);

Callers 1

Calls 1

addMethod · 0.95

Tested by

no test coverage detected