Array Iteration in JavaScript

var myArray = new Array(4);
      myArray[0] = "A";
      myArray[1] = "B";
      myArray[2] = "C";
      myArray[3] = "D";
      myArray[6] = "E";
     delete myArray[1]
     for (var i = 0; i < myArray.length; i++){
       if (myArray[i])
        document.write("myArray[" + i + "] = " + myArray[i] + "<br>");
     }