- Conventional arrayThe classic conventional array looks like the following:
var mystudents=new Array() mystudents="Bob" mystudents="Jane" mystudents="Peter"
You can expand and contract the array as desired, by adding new array
elements. Note that like in most other programming languages, the first array
element should have an index number of 0.
With a conventional array, you have the option of presetting the array’s
length when defining it, by passing in a numeric integer into the Array()
var mystudents=new Array(3)
In this case 3 array elements will automatically be created, each with a
value of “undefined.” It also means probing the property
mystudents.length will return 3.