function f(count){
if(count[0].getUpc>=count[0].num&&count[1].getUpc>=count[1].num&&count[2].getUpc>=count[2].num&&count[3].getUpc>=count[3].num){
return [ count[0],count[1],count[2],count[3] ];
}else{
var i = 0,len = count.length;
for(;i<len;i++){
if(count[i].getUpc<count[i].num){
count[i].num = f(arrfn(count,i));
}
}
}
return count;
}
这串代码递归转成递推进行了以下尝试
其中arrfn()会返回4个对象组成的数组,但是最后得到的只有一个对象,想知道该怎么修改