I want to create an array containing objects that have a key data which is an array of values. I am trying to push values into data but it's not working for me.
My expected result looks like this:
array = [
{ data:[3,2,5] },
{ data:[5,2,1] }
]
So I want to fill the data arrays. To do this, I have tried populating the arrays with a for loop:
var array = [];
for(i=0;i<2;i++){
for(j=0;j<3;j++){
array[i]["data"][j].push(2);
}
}
But this is not working for me.
pushis not a value method.