I am currently trying to display an array of objects as rows in an html table. I am new to javascript and I am having trouble accessing individual elements in the array.
In the console the array is: [Object, Object, Object, ... Object, Object, Object] 65 total objects.
Each object has a field called id and each object in the console shows it as follows:
0: Object
...
id: 10
...
I tried accessing id with the following code:
for (var item in data) {
console.log(item);
console.log(item['id']);
}
This shows me the object number followed by a line that says undefined. I know that the data has a value because I can view it in the console but I can't access using dot notation or the above notation. Any assistance would be greatly appreciated.