Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Javascript-array JavaScript array of arrays

Related Tutorials


 
 

Share on Google+Share on Google+

JavaScript array of arrays

Advertisement
In this Tutorial we want to describe you a code that help you in understanding JavaScript array of arrays.

JavaScript array of arrays

     

In this Tutorial we want to describe you a code that help you in understanding JavaScript array of arrays. For this we are using JavaScript as Script language. We instantiate an array object by passing argument and object of array to it and allocate them to the memory. The element in the array can be accessed by its numerical index. Finally the document. write print the list of  element in an array.

 

 

 

 

 

 

javascriptArrayofArray.html

<html>
<head>
<title>JavaScript Array of Arrays</title>
</head>
<body>
<h1>JavaScript Array of Arrays</h1>
<script language="Javascript">
var array = new Array("Rose","India",564,375,new Array(5,6,7),".net")
document.write("array[0] = "+array[0]+"<br>")
document.write("array[1] = "+array[1]+"<br>")
document.write("array[2] = "+array[2]+"<br>")
document.write("array[3] = "+array[3]+"<br>")
document.write("array[4][0] = "+array[4][0]+"<br>")
document.write("array[4][1] = "+array[4][1]+"<br>")
document.write("array[4][2]= "+array[4][2]+"<br>")
document.write("array[5]= "+array[5]+"<br>")
</script>
</body>
</html>

Output of the program

Download source code

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 10, 2008

Related Tutorials

Discuss: JavaScript array of arrays  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com