January 2001
Beginner
312 pages
6h 4m
English
Arrays are a powerful feature of most programming languages, and they are also available to the JavaScripter! An array enables you to store several separate values within a single variable. Usually, all these values have a connecting theme (such as days of the week). Arrays are great because when you know how to use them they can really simplify your code—saving you from having to create a bunch of separate variables with similar names.
So, let's look at how to create and use arrays. The example here will be used to hold the seven days of the week.
The first thing you need to do is to bring the array into existence:
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- Cloaking device on! var days_of_week ...
Read now
Unlock full access