我正在設(shè)置我的代碼并遇到問題.. 這段代碼只是我想要做的一個例子。所以基本上 config.Te[i].ref 應(yīng)該讀取 Te 中的所有 ref .. 但它只讀取第一行而不是 Te 中的所有行...問候for (var i in config.acc,config.Te,config.Hu,config.Ve) console.log(config.Te[i].ref) {}當我將日志輸出更改為 config.acc[i].ref 或其他時,它也僅讀取該特定配置的第一行。但是當我將其更改為 for (var i in config.acc) 時,它會讀取所有引用...所以我認為我的代碼格式錯誤,我不知道如何修復(fù)它。錯誤必須是在分離配置。我只想 1 比 1 分別稱呼它們。"acc": [ {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 }, {"type":"PIR", "ref":0 } ],
從配置問題讀取的多個 FOR var 循環(huán)
尚方寶劍之說
2021-06-16 05:07:41