I have five arrays outside of a function. What I am trying to achieve is when itemDetail is
concatenated it will give me the name of that array and I will be able to access the elements
but how do I call an array when the var is a string if I itemDetail[2] it will goto the letter in the
string? thanks
Code:itemA = new Array(a,b,c); itemB = new Array(a,b,c); itemC = new Array(a,b,c); itemD = new Array(a,b,c); itemE = new Array(a,b,c); function arrayFind (itemVar){ var itemDetail = "item"+itemVar; alert(itemDetail); // get these elements } arrayFind ('C');



Reply With Quote

Bookmarks