I have the following object definition:
var idObject = {
item1: "",
item2: "",
item3: "",
array1: [],
array2: [],
array3: []
}
There will always be the same number of items in array1, array2, and array3, so array1.length will equal array2.length will equal array3.length. For this example, lets assume there are 3 items in array1, 3 items in array2, and 3 items in array 3.
There will be multiple instances of the object, so I push them into a different array with this line of code:
idArray.push(idObject);
In this example, lets assume that I end up creating 2 idObject.
Im trying to render the structure. The output should look something like this:
item1 item2 item3
array1[1] array2[1] array3[1]
array1[2] array2[2] array3[2]
array1[3] array2[3] array3[3]
item1 item2 item3
array1[1] array2[1] array3[1]
array1[2] array2[2] array3[2]
array1[3] array2[3] array3[3]
I'm having a problem coming up with the logic to render the data. Any assistance is greatly appreciated.
[{"id": 1, "ary":[]},{"id":2,"ary":[]},...]instead of an object containing arrays? Then you can just loop over each item individually and you have all the data you need to create one of the items without the need to refer to array1/array2/array3.