Create array with all unique combinations

前端 未结 1 1420
借酒劲吻你
借酒劲吻你 2021-01-27 19:57

Can\'t figure out how to create an array with all matches. I suppose I need a recursive function for this.

I like to get all values from the JSON below and create an ar

1条回答
  •  执念已碎
    2021-01-27 20:26

    var indices = [];
    var lengths = [];
    for (i = 0; i= 0; j--) {
            indices[j]++;
            if (indices[j] >= lengths[j] && j != 0) {
                indices[j] = 0;
            } else {
                break;
            }
        }
    }
    

    0 讨论(0)
提交回复
热议问题