【发布时间】:2022-01-10 20:46:26
【问题描述】:
我得到了这个对象:
"contributionData": {
"Contribution 1": [
4,
4
],
"Contribution 2": [
1,
1
]
}
我想要迭代后的这种表。
contribution1 | 4 | 4 |
contribution2 | 1 | 1 |
我已将其转换为数组:
let result = [];
for(let i in this.state.testData) {
result.push([i, this.state.testData[i]]);
}
console log after converting it to array
<tr>
<td>{this.state.result}</td>
</tr>
我想以表格形式填写这些数据 我正在研究 React js,我想在 javascript 中执行此操作。
任何帮助将不胜感激。
【问题讨论】:
-
请展示你的尝试
-
我看不出有什么不同,请发布您想要的 jon
标签: javascript arrays reactjs json iteration