2 回答
TA贡献1898条经验 获得超8个赞
let arr = [
{
value: [
2.54,
14.92,
3.5,
2.57,
1.64,
8.85,
5.59,
51.63,
3.02,
5.74
],
name: [
"input",
"output",
"initialization",
"pvtProperties",
"rockProperties",
"equationSetup",
"networkWells",
"solver",
"update",
"misc"
]
}
];
console.log(arr[0].value.map((v, i) => ({ value: v, name: arr[0].name[i] })));
TA贡献1780条经验 获得超3个赞
不知道为什么每个value都是335,但这里是 -
const arr = [
{
"value":[
2.54,
14.92,
3.5,
2.57,
1.64,
8.85,
5.59,
51.63,
3.02,
5.74
],
"name":[
"input",
"output",
"initialization",
"pvtProperties",
"rockProperties",
"equationSetup",
"networkWells",
"solver",
"update",
"misc"
]
}
];
const data = arr[0].name.map(e => ({value: 335, name: e}));
console.log(data);
添加回答
举报