Skip to main content

One-Dimensional Array Example

 
<script language="JavaScript" type="text/javascript">
<!--

// Declare the array
var code_listings = new Array(5) 

// Initialize the array values
code_listings[0] = "10.1"
code_listings[1] = "10.2"
code_listings[2] = "10.3"
code_listings[3] = "10.4"
code_listings[4] = "10.5"

// Display an example
alert(code_listings[0] + ".htm")

//-->
</script>
 

Next: Two-Dimensional Array