<HTML>
<HEAD>
<TITLE>
Iteration
</TITLE>
</HEAD>
<BODY>
<H1>
<SCRIPT>
var myArray = new Array(4);
myArray[0] = "A";
myArray[1] = undefined;
myArray[2] = "C";
myArray[3] = "D";
myArray[6] = "E";
delete myArray[2]
for (var i = 0; i < myArray.length; i++){
if (myArray[i] != undefined)
document.write("myArray[" + i + "] = " + myArray[i] + "<br>");
}
</SCRIPT>
</H1>
</BODY>
</HTML>
|