Please send questions to
st10@humboldt.edu .
<html>
<!--
js_arr2.html
adapted by: Sharon Tuttle
last modified: 09-07-06
-->
<head>
<title> js_arr2 </title>
</head>
<body>
<h3> js_arr2.html </h3>
<h4> (by Sharon Tuttle, last modified 09-07-06) </h4>
<hr>
<script type="text/javascript">
<!--
var amounts = new Array(10)
amounts[5] = 27;
amounts[7] = 13;
// what is in the other array elements?
document.write("<h2> USING A TRADITIONAL FOR LOOP, " +
"What is in the amounts array?",
" </h2>")
document.write("<ul>")
for (var i = 0; i < amounts.length; i++)
{
document.write("<li> amounts[" + i + "]:" +
amounts[i] + " </li>")
}
document.write("</ul>")
document.write("<h2> USING FOR..IN, " +
"What is in the amounts array?",
" </h2>")
document.write("<ul>")
for (i in amounts)
{
document.write("<li> amounts[" + i + "]:" +
amounts[i] + " </li>")
}
document.write("</ul>")
//-->
</script>
<noscript>
<hr>
<h3> Your browser does not support JavaScript, or has it disabled;
<br>
please note that, as a result, this page will not work. </h3>
<hr>
</noscript>
<hr>
</body>
</html>