您的位置:首页 > Web前端 > JavaScript

Js笛卡尔乘积

2015-07-24 15:10 573 查看
self.getDescartesSku = function (selSaleProp, i, nowLst, allALst) {

if (selSaleProp.length == 0) {

return;

}

if (i == selSaleProp.length - 1) {

for (var tempi = 0; tempi < selSaleProp[i].values.length; tempi++) {

var tempA = nowLst.concat(selSaleProp[i].values[tempi]);

allALst.push({ SaleProps: tempA });

}

} else {

for (var tempi = 0; tempi < selSaleProp[i].values.length; tempi++) {

var tempA = nowLst.concat(selSaleProp[i].values[tempi]);

self.getDescartesSku(selSaleProp, (i + 1), tempA, allALst);

}

}

};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: