Node.js examples for Data Structure:List
list To Array
function listToArray(list) { var finalArray = [] for (var node = list;node;node = node.rest) { finalArray.push(node.value)/*from ww w . j a v a 2 s. c om*/ } return finalArray; } console.log(listToArray(arrayToList([10, 20, 30])));