Javascript: find array by name

Posted by Kin on Stack Overflow See other posts from Stack Overflow or by Kin
Published on 2010-05-16T17:20:05Z Indexed on 2010/05/16 17:30 UTC
Read the original article Hit count: 188

Filed under:
|

Hi,

I have some js arrays and I want to find the arrays by name. for example:

arr1 = [1,2,3];
arr2 = [3,4,5];

And access them like this:

var intNum = 2;
var arrName = 'arr' + intNum;

arrName[0]; // equals 3

Is this possible?

Thanks, Kevin

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about arrays