it's frustrating that we can't select JSON elements (or really any elements) using a similar code like this:
//An JSON object is parsed into Response beforehand
for(var count = 1; count <= Response.objCount; count ++) {
console.log(Response.obj+count.content);
}
In the code, I want to output a JSON object like this:
{ "objCount" : 2 ,
"obj1" : { "result" : true ,
"content" : "blah blah 1" } ,
"obj2" : { "result" : true ,
"content" : "blah blah 2" } }
But no, we can't use variable as whole or part of an identifier in Javascript.. So, any suggestions on how to handle such JSON objects when I want to output each and every object?
Thank you!