I'm trying to access a nested javascript object within a for loop. The first level objects show up just fine, but the second level children show up as undefined. However if I do this outside a loop, hard-coding the object access, it works just fine. What is going on?
This is the object I'm trying to access:
var groups = {
"group1": {
"sum": 25,
"count": 5
},
"group3": {
"sum": 5,
"count": 5
}
}
See what I mean here: https://jsfiddle.net/97o1jme2/