{"topic1":{"609":["A","B"],"610":["C","D","E"]}}在js中如何把609,610,A,B,C,D,E分别提取出来?
1 回答
函数式编程
TA贡献1807条经验 获得超9个赞
var obj = {"topic1":{"609":["A","B"],"610":["C","D","E"]}};
for(var p in obj.topic1) {
console.log(p); //获取到609、610
var t = obj.topic1[p];
for(var i = 0; i < t.length; i++){
console.log(t[i]); //获取A、B、C、D、E
}
}
添加回答
举报
0/150
提交
取消