Node.js examples for Data Structure:List
array To List
function arrayToList(array) { var list = null for (var i=array.length-1;i>=0;i--) { var tempList = {} tempList.value = array[i]//w w w . jav a 2 s. c om tempList.rest = list list = tempList // list.value = array[i] // list.rest = } return list; } console.log(arrayToList([10, 20]));