第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

想知道這兩層循環(huán)中i,和j的變化,里外層循環(huán)是怎么走的?

想知道這兩層循環(huán)中i,和j的變化,里外層循環(huán)是怎么走的?

手掌心 2018-09-10 12:06:41
                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                                 });                             }                         }                     }想知道這兩層循環(huán)中i,和j的變化,里外層循環(huán)是怎么走的,以及這段代碼的意思,只能看懂一半!
查看完整描述

1 回答

?
料青山看我應(yīng)如是

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超8個(gè)贊

這個(gè)是取差集

var temp1 = [{name:"a"},{name:"d"},{name:"c"}];var combination_name_list = ['a'];

//結(jié)果var combination = [{name:"d"},{name:"c"}];

combination_name_list 中存的是 temp1 的 name

就是拿著 temp1 中 第一項(xiàng) 去 combination_name_list 中找 找到了 不操作 ,沒找到 將這一項(xiàng)加進(jìn) 新數(shù)組combination 以此類推 第二項(xiàng) 。。。


查看完整回答
反對(duì) 回復(fù) 2018-09-10
  • 1 回答
  • 0 關(guān)注
  • 564 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)