MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / addNode

Method addNode

code/chapter/22_fast.js:8–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 }
7
8 addNode() {
9 let id = this.#nodes.length;
10 this.#nodes.push(new Set());
11 return id;
12 }
13
14 addEdge(nodeA, nodeB) {
15 this.#nodes[nodeA].add(nodeB);

Callers 1

gridGraphFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected