How can I use a string as an array index?

Firat Tiryaki

When initializing the value, just use the desired index, as in the following: myarray=new Array();
myarray["blah"]="blah blah blah";

the "blah" indexed element of myarray is equal to "blah blah blah" now.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.