Saturday, March 19, 2011

Arrays in Javascript

 function start() {  
      var example=new Array();  
      example[0]="first";  
      example[1]="esc";  
      for(var i=0;i<example.length;i++){  
           alert(example[i]);  
      }  
      example[example.length]="third";  
      alert(example.length+" "+example["esc"]);  
 }  

No comments: