Reference array element by string index
<HTML> <HEAD> <SCRIPT language="JavaScript"> var car= new Array() car["a"]="A"; car["b"]="B"; car["c"]="C"; </SCRIPT> </HEAD> <BODY> <H2>List of Cars:</H2> <SCRIPT language="JavaScript"> document.write(car["a"]+"<BR>"); document.write(car["b"]+"<BR>"); document.write(car["c"]); </SCRIPT> </BODY> </HTML>