Delete an array element : Introduction : Array JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Array » Introduction »

 

Delete an array element

















<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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Array
» Introduction