for (let i = 0; i < this.temp1.length; i++) { let found = false; for (let j = 0; j < combination_name_list.length; j++) { if (combination_name_list[j] == this.temp1[i].name) { found = true; } if (j == combination_name_list.length - 1 && found == false) { this.combination.push({ "name": this.temp1[i].name, "rows1": this.temp1[i].rows, "rows2": [], "type": this.temp1[i].type }); } } }
想知道这两层循环中i,和j的变化,里外层循环是怎么走的,以及这段代码的意思,只能看懂一半!
料青山看我应如是
为什么内层循环的j
为什么第二层循环的j一定得是j
这是什么原理,第二循环中 j < i+1 和 j
这个是什么意思求问:“内层循环变量的最大值和外层循环变量的值相等。”
相关分类