I'm having the hardest time getting this to work. I'm trying to generate a lot of stuff dynamically to allow for my script to be easily customizable and I can't figure out a way around this.
I have to store some objects in an array and i have several different arrays I need to keep them in. I tried eval, but that doesn't seem to be working. then I tried creating a new object, but what I figured out is I need a separate object for each dynamic variable, which brings me back to square one.
This is the javascript I need
And this is what I'm trying to use to get it
What is the best way to do this?
I have to store some objects in an array and i have several different arrays I need to keep them in. I tried eval, but that doesn't seem to be working. then I tried creating a new object, but what I figured out is I need a separate object for each dynamic variable, which brings me back to square one.
This is the javascript I need
Code:
var the_numbers = new Array();
var the_digits = new Array();
var the_emails = new Array();
And this is what I'm trying to use to get it
Code:
for(items in custom_variables){
eval("var " + custom_variables[items]['indexName'] + " = new Array()");
}
What is the best way to do this?