是否可以迭代JSON对象,其中键包含递增的数字?
有问题的JSON如下:
class myPOJO {
Long myDate;
}
这是我的代码:
{
key0: 'adbid1,23',
key1: 'adbid2,21',
key2: 'adbid3,191',
}
答案 0 :(得分:-2)
请改为尝试:
var query = {
key0: 'adbid1,23',
key1: 'adbid2,21',
key2: 'adbid3,191',
}
function a() {
for(var i in query){
var submitray = query[i].split(",");
var qid = submitray[0];
var userAnswer = submitray[1];
console.log(userAnswer);
}
}
a(); // init the function