I have an array that I am adding objects to. I would like to control the number of objects that are added to the array using a number.
for (var i = 0; i < numberOfCountries; i++) {
chartArray[i] = obj[i];
}
I am trying to get this:
chartArray[0] = obj0;
chartArray[1] = obj1;
chartArray[2] = obj2;
chartArray[3] = obj3;
chartArray[4] = obj4;
chartArray[5] = obj5;
chartArray[i] = window.["obj " + i];?if (chartArray.length > 5) break;