I have to get this structure in Javascript
:
In it I will keep objects in the first column and in the second one an amount that will be a whole number. I have to create it with a two-dimensional array. I have tried a thousand ways, but something escapes me. The closest I get is this:
arrayCompras[0]=new Array();
arrayCompras[0][0]=objetoProducto;
arrayCompras[0][1]=1;
But I do not know if I go. Apart if I want to enter more data in array
as I do?
If I try this.
arrayCompras[1][0]=objetoProducto2;
arrayCompras[1][1]=2;
I miss an error.
Can not set property '0' of undefined.
Solutions?