这是A数组
这是B数组
Bdata: [ { parameter: "c", value: 0 }, { parameter: "orp", value: 2 }, { parameter: "user_id", value: 4 }, ]
A数组里的c跟B数组的某个值相同,比如“c”,就取A数组的水温+B数组的0,组成一个新数组。
const c = [] a.forEach(item => { b.forEach(child => { if (item.cloumn_name === child.parameter) { c.push(item.column_comment + child.value) } }) }) console.log(c)
2.1m questions
2.1m answers
62 comments
56.7k users