Hello
I have to use the code below.
I don't want to use [ new Array() ] . <== new memory allocation
I need to replace [ new Array() ] in the code below.
Is there a way other than [ new Array() ] ?
I have to use the code below.
I don't want to use [ new Array() ] . <== new memory allocation
I need to replace [ new Array() ] in the code below.
Is there a way other than [ new Array() ] ?
Code:
var colval = new Array();
for (i=0; i<each.length; i++)
{
var ID = each[i].ID.tostring();
colval[ID] = new Array();
}
for (i=0; i<each.length; i++)
{
ID = each[i].ID;
NAME = each[i].NAME;
colval[ID].push(NAME);
}