Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/marijnh/Eloquent-JavaScript
/ addEdge
Method
addEdge
code/chapter/22_fast.js:14–17 ·
view source on GitHub ↗
(nodeA, nodeB)
Source
from the content-addressed store, hash-verified
12
}
13
14
addEdge(nodeA, nodeB) {
15
this.#nodes[nodeA].add(nodeB);
16
this.#nodes[nodeB].add(nodeA);
17
}
18
19
neighbors(node) {
20
return
this.#nodes[node];
Callers
1
gridGraph
Function · 0.95
Calls
1
add
Method · 0.45
Tested by
no test coverage detected