Use string as the index and use for loop to loop through it
<html>
<head>
<title>Array literal</title>
<script type="text/javascript" >
var planets = [];
planets['inner'] = ['A', 'B', 'C'];
planets['outer'] = ['a', 'b', 'c'];
for (var i in planets)
{
document.write(planets[i]);
document.write("<BR>");
}
</script>
</head>
<body>
</body>
</html>
Related examples in the same category