You can use arrays as some of the comments have described, or you can use object properties. They involve similar notation, but work differently. For instance, you could do something like this:
var options = { option0 : ['a', 'b', 'c'],
option1 : ['d', 'e'],
...
};
var a = 0;
var count = options['option' + a].length; // assigns 3 to count
This access the property of options
named 'option' + a
(or, with this sample code, option0
).
While you can easily compute and use property names, you cannot (as also pointed out in the comments) do this with local variable names.