Given that EVAL is Evil how do I create an Array name dynamically:
I have a bunch of Arrays and I need to reference different ones depending on what the user clicks.
This bit of code gives me the array object:
(eval(calendarObject.id + '7'))
But eval is bad, so how to do I construct an Array name and then reference it?
Here's a bit more context:
if (jQuery.inArray(String(checkinDate.getTime()/1000),
(eval(calendarObject.id + '7'))) == -1 ) { //do stuff };
Any ideas?
thanks.