Iterating Through a Sparse Array : Array : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Array »

 

Iterating Through a Sparse Array



<HTML>
<HEAD>
<TITLE>Iterating Through a Sparse Array</TITLE>
</HEAD>
<BODY>
<SCRIPT
      var myArray = new Array(4)
      myArray[0"d"
      myArray[1"c"
      myArray[2"s"
      myArray[3"d"
      myArray[6"c"
      myArray[1= undefined; 
     for (var i = 0; i < myArray.length; i++){ 
       if (myArray[i!= undefined
        document.write("myArray[" + i + "] = " + myArray[i"<br>")
     
</SCRIPT>
</BODY>
</HTML>
           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Array