MCPcopy 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

23time(findPath_set);
24
25function pathToArray(path) {
26 let result = [];
27 for (; path; path = path.via) result.unshift(path.at);
28 return result;
29}
30
31function findPath_list(a, b) {
32 let work = [{at: a, via: null}];

Callers 1

findPath_listFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected