javascript - give name of a Variable from member of array -


i want give name of variable member of array below ... show's syntaxerror: parse error

var nemads=new array("akhaber","mafakher"); var nemads[i] = new stocks(nemads[i],urls[i],""); 

what can ?

kind of, this:

var nemads=new array("akhaber","mafakher"); var arr = {};  (var = 0; < nemads.length; ++i) {     arr[nemads[i]] = "test" + i; }  (var in arr) {     var item = arr[i];      console.log(item); }  console.log(arr["akhaber"]); 

output:

test0 test1 test0 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -