Using Functions to Iterate Through an Array : Array : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Array »

 

Using Functions to Iterate Through an Array



<HTML>
<HEAD>
<TITLE>Iteration Two</TITLE>
<SCRIPT
   function makeArray() { 
       var myArray = new Array(4)
       myArray[0"L"
       myArray[1"l"
       myArray[2"a"
       myArray[3"p"
       return myArray; 
   
    function showArray(theArray){ 
      var quote = ""
      for (var i = 0; i < theArray.length; i++){ 
         quote += theArray[i" "
      
      return quote; 
    
   </SCRIPT>
</HEAD>
<BODY>
<H1>
<SCRIPT
      var x = makeArray()
      document.write(showArray(x))
   </SCRIPT>
</H1>
</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