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

Function arrayToList

code/solutions/04_3_a_list.js:1–7  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

1function arrayToList(array) {
2 let list = null;
3 for (let i = array.length - 1; i >= 0; i--) {
4 list = {value: array[i], rest: list};
5 }
6 return list;
7}
8
9function listToArray(list) {
10 let array = [];

Callers 1

04_3_a_list.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected