January 2001
Beginner
312 pages
6h 4m
English
Here is a much faster way to create the exact same array that you have in the previous example—this time, all in one line:
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!-- Cloaking device on!
var days_of_week = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday", "Friday"
,"Saturday");
// Cloaking device off -->
</script>
</head>
<body>
</body>
</html>
The advantage of creating the array in this way is that you don't need to worry about how many elements there are in advance. Using this method, an array with the appropriate number of elements is created automatically.
This array ...
Read now
Unlock full access