let columns = ["name", "age", "weight"] // 里面的值是接口请求回来的,不固定有多少个的
let data = [["jack", 18, 50],["jenny", 22, 60]]
let arr = []
//最后结果我想要这样的
[
{"name": "jack","age": 18,"weight": 50},{"name": "jenny","age": 22,"weight": 60},{"name": "合计","age": 40,"weight": 110}
]
{"name": "合计","age": 40,"weight": 110} 最后一个是age跟weight进行累积相加push到数组中
一只萌萌小番薯
叮当猫咪
明月笑刀无情
相关分类