Use string as the array indexer : String Indexer : Array JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Array » String Indexer »

 

Use string as the array indexer

















<html>
<head>
<title>Mixing Notations</title>

<script language="javascript" type="text/javascript">
<!--

var x = new Array();
x["first"]  "1st";
x["second""2nd";
x["third"]  "3rd";

alert(x.first + ", " + x.second + ", " + x.third);

//-->
</script>

</head>
<body>

<h1>Mixing Notations</h1>

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Array
» String Indexer