MCPcopy Create free account
hub / github.com/braziljs/eloquente-javascript / listToArray

Function listToArray

code/solutions/04_3_a_list.js:9–15  ·  view source on GitHub ↗
(list)

Source from the content-addressed store, hash-verified

7}
8
9function listToArray(list) {
10 let array = [];
11 for (let node = list; node; node = node.rest) {
12 array.push(node.value);
13 }
14 return array;
15}
16
17function prepend(value, list) {
18 return {value, rest: list};

Callers 1

04_3_a_list.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected