I cannot wrap my head around this problem. Here is how my array is logically built:
array1 = [ [array2], [array3], [array4] ... [array17] ]
array2 = [ ['obj1'], ['obj2'], ['obj3'] ... ['obj30'] ]
...
...
obj1 = ({prop1 : 'string1'}, { prop2 : 'string2'}, {prop3 : 'string3'} ... {prop30 : 'string30'})
obj2 = ({prop1 : 'string1'}, { prop2 : 'string2'}, {prop3 : 'string3'} ... {prop30 : 'string30'})
obj3 = ({prop1 : 'string1'}, { prop2 : 'string2'}, {prop3 : 'string3'} ... {prop30 : 'string30'})
...
...
obj30 = ({prop1 : 'string1'}, { prop2 : 'string2'}, {prop3 : 'string3'} ... {prop30 : 'string30'})
I want to flatten it into a JSON object like :
{"array1":[
{ "array2":[
{"obj1":[
{"prop1" : "string1",
"prop2" : "string2"
}
}]
}]
]}
Here is what I came up with:
for (i=0; i < array1; i++) {
var count = 0
while (count < array1[0].length) {
var jsonObj = {
array[i] : {
array[count] : {
obj[count] : {
'prop1' : 'string1'
}
}
}
}
count++;
}
}