• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using Arrays

An array is an indexed list of values that can be referred to as a unit. Arrays can contain any type of value. Before you can use an array, you must first declare it. The following example shows how to create an array that will hold 10 strings that contain information about an automobile inventory.

Auto = new Array(10);
Auto[0] = 98 Ford Explorer;
Auto[1] = 97 Ford Explorer;
Auto[2] = 85 Plymouth Mustang;
Auto[3] = 96 Plymouth Voyager;
Auto[4] = 90 Honda Civic;
Auto[5] = 97 Honda Civic;
Auto[6] = 96 Plymouth Neon;
Auto[7] = 98 Plymouth Neon;
Auto[8] = 92 Ford Explorer Wagon;
Auto[9] = 95 Honda Civic Hatchback;


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint