<html>
<head>
<title>Initialize Array With Declaration</title>
</head>
<script
language ="javascript">
function start()
{
var colors =new array("Cyan","Magenta","Yellow","Red");
var integers1=[2,4,6,8];
var integers2=[2,1,8];
outputarray("Array Colors Contains",colors);
outputarray("Array integer1 contains",integers1");
outputarray("Array
integer2 contains",integers2");
}
function output array(header,tha array)
{
document.writeln("<h2>"+header+"</h2>");
document.writeln("<table
border="1" width="100%>");
document.writeln("<tr><td width ='100'><b>subscript</b>"+"<td><b>Valu</b></tr>");
for(var i=0;i<thearray.length;i++)
document.writeln("<tr><td>"+i+"<td>"+ the array[i]+"</tr>");
document.writeln("</table>");
}
</script>
</head>
<body onload ="start()">
</body>
</html>