//校验是否重复 let lotBarcode = 111; let count = 0; let A = [ { data:[{ lotBarcode:111, }]//C层 },//B层 { data:[{ lotBarcode:111, }] } ]; for (const B of A) { for (const C of B.data) { if (C.LotBarcode == lotBarcode) { count++; if (count >= 2) { console.log('已重复:'+count+'次') return; } } } }