can anyone help me figure what i did wrong in my code? Cause I wanna created a function which can help me turn all the array data into list and print the list out.
You may try this as well :
function arrayToList(arrayx){ for(var i = arrayx[0];i < Math.max.apply(Math,arrayx); i+=arrayx[0]) { var list = { value: i, rest: { value: i+=10, rest: null } } return list; } } console.log(arrayToList([10 , 20]));