0

I am creating an array like this:

for (var i = 0; i < mynumber; i++) {
    batch[i] = oSelectedItems[""+i].mAggregations.cells["0"].mProperties.title;
}

so my array batch can contain any number of lines. Now I need to create individual variables from the array, let's say:

var1 = batch[0],
var2 = batch[1]

and so on.

How can I achieve that when I do not know the number of lines?

Tim
  • 71
  • 4
  • 13
  • 4
    Why would you need these variables? What is the purpose of variables being generated dynamically and accessed dynamically? What is the advantage of `var2` over `batch[1]`? – Yeldar Kurmangaliyev Feb 25 '17 at 06:48
  • All computer programs are dynamic by definition. –  Feb 25 '17 at 06:55

0 Answers0