I want to create a new object and assign some properties for each array stored within some json. I have this mostly working except...
for (var i in json) {
a = 0;
a++;
a = new Object();
for (var key in json[i]) {
var Key = key;
var Value = json[i][key];
a[Key] = Value;
}
a.outputProperties();
}
When I output the object properties, everything is undefined.
If I create a single object outside the loop and assign the properties to it, it seems to work OK except that the first set of properties get overwritten with the following. Not sure why I wouldn't be able to create objects and assign properties inside the loop dynamically.