更改时从数组生成结果

时间:2019-06-21 03:30:35

标签: javascript

您好,我有三个数组,我想生成这样的结果: enter image description here

这是我的数组

line1 = ["A1", "A2", "A3"];
line2 = ["B1", "B2", "B3", "B4"];
line3 = ["C1", "C2"];

这是我的代码,我不知道它是正确的算法还是否

function factorial(nbrElement){
if(nbrElement === 1)
    return 1;
return nbrElement * factorial(nbrElement - 1 );
}

0 个答案:

没有答案