SixtySoftWorks
2004.01.03, 01:37 PM
The following code always returns a value of 3 on my Mac. How can I have my script return "4"?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>Untitled</title>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<script>
var test = new Array()
test[1,1] = "1"
test[1,2] = "2"
test[2,1] = "3"
test[2,2] = "4"
test[3,1] = "5"
test[3,2] = "6"
test[4,1] = "7"
test[4,2] = "8"
document.write(test.length)
</script>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>Untitled</title>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<script>
var test = new Array()
test[1,1] = "1"
test[1,2] = "2"
test[2,1] = "3"
test[2,2] = "4"
test[3,1] = "5"
test[3,2] = "6"
test[4,1] = "7"
test[4,2] = "8"
document.write(test.length)
</script>
</body>
</html>