Example of Using an Array
An array can use a number as an index, so it allows you to work with sequential data. For example, to keep track of how many jelly beans you eat each day, you can graph your jelly bean consumption at the end of the month. An array provides a solution for storing such data. For example:
var April = new Array;
April[1] = 233;
April[2] = 344;
April[3] = 155;
April[4] = 32;
In this example, one variable contains all the data. You can write code that examines the value of April[x] to determine how many jelly beans you ate on day x. For example:
for(var x = 1; x < 32; x++)
TheApplication().Trace("On April " + x + " I ate " + April[x] +
" jellybeans.\n");