I need to dynamically create arrays in runtime based on count. For example if I have an source array sourcearr = ['arr1','arr2','arr3','arr4']
, the count of the elements of sourcearr is 4 i.e. var count = sourcearr.length
, I need something like:
for(i=0;i<count;i++)
{
//define 4 dynamic arrays here
//basically create arr1 = [],arr2 =[], arr3=[],arr4=[]; dynamically.
}
Is there any way to create and then access these arrays dynamically?