I have a collection of arrays in my script, as follows
var data0 = [100,10,15,20];
var data1 = [5,100,15,20];
var data2 = [5,10,100,20];
var data3 = [5,10,15,100];
I am getting an input through a click event, which will be the index of the click.
function clickEvent(i) {
var dataNum = "data" + i;
        render2(i); 
    }
I want to set a new var equal to the array at the index which we got as an input. In java, this would have worked. But here, I think dataNum is a string and not an array. Anyway I can set dataNum to array?
For example, when my click event returns index 0, I want dataNum to be set to array data0
Thanks in advance :)


