JavaScript changing object list to array. return undefined -


function listtoarray(list){     var newarray = [];     repeat();     function repeat(){         newarray.push(list.value);         if(list.rest == null){             return obj = newarray; // don't know why returns undefined here         }         else {         list = list.rest;         repeat();         }     } }  // , return array  function return(){     var listvar = [5, 4, 3, 2, 1];     return obj = listvar; } 

this function change obj when in console, returns undefined. can me? please

just return newarray - can't return assignment that.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -