In Navigator 3, we write: |
var area = new Array(); |
area[0] = "Alabama"; |
area[1] = "Alabama"; |
area[2] = "Alaska"; // etc. |
var acode = new Array(); |
acode[0] = 205; // mapping area codes to states |
acode[1] = 334; |
acode[2] = 907; |
area.length gives the length of the array ( 3 in this case) |
Note you can set array elements to be objects to make arrays of objects: |
menuArray = new Array(); |
menuArray[0] = new MenuObject(1, 'world'); |
worldMenu = menuArray[0]; // a synonym |