Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/marijnh/Eloquent-JavaScript
/ pathToArray
Function
pathToArray
code/solutions/22_3_optimizing.js:25–29 ·
view source on GitHub ↗
(path)
Source
from the content-addressed store, hash-verified
23
time(findPath_set);
24
25
function
pathToArray(path) {
26
let
result = [];
27
for
(; path; path = path.via) result.unshift(path.at);
28
return
result;
29
}
30
31
function
findPath_list(a, b) {
32
let
work = [{at: a, via: null}];
Callers
1
findPath_list
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected