data = [];
data.push({arrayName:x,secondArray: {name:x, value:y}});
Now how can you push an item into secondArray ? have tried with
data[0].secondArray.push({name:x, value:y});
But getting error like data[0].secondArray.push() is not a function.
{arrayName:x,secondArray: {name:x, value:y}}is object notarray..Trydata[0].secondArray={name:x, value:y};or if you wantsecondArrayto be an array then initialize it as anarray.ata[0].secondArray.push({name:x, value:y});will work in that case..