Below is code that I have been working on for the past two days. The problem is it won’t work and I can’t figure out why. Somebody help me please?
[code]
<html>
<head>
<title>Array Practice</title>
<style type = “text/css”>
table { width: 10em }
th { text-align: left }
</style>
<script type=”text/javascript”>
<!–
var n1= new Array(5);
var n2= new Array();
for (var i=0; i < n1.length; ++1)
n1[ i ]=i;
for ( var i = 0; i < 5; ++i)
n2[ i ]=i;
outputarray(“Array n1:”, n1);
outputarray(“Array n2:”, n2);
function outputarray(heading, thearray)
{
document.writeln(“<h2>” + “heading” + “</h2>”);
document.writeln(“<table border = “1”>”);
document.writeln(“<th>Subscript</th>” + “<th>Value</th>”);
for ( var i = o; i < thearray.length; i++)
document.writeln(“<tr><td>” + i + “</td><td>” + thearray[i]+ “</td></tr>”);
document.writeln(“</table>”)
}
//–>
</script>
</head>
</html>