I want to add a value to specific field of my array which is a json object. in other words i want to append to a json object which is a field of another array.
var cdata = new Array();
for (i in json2) {
for (j in json2[i]) {
//here i get error:
cdata[j].push({
'x': json2[i].timestamp,
'y': json2[i][j]
});
};
};
but i get Uncaught TypeError: Cannot call method 'push' of undefined error.
thanks in advance