HELP! * GREY=local LOCAL HTML version of Foils prepared 15 January 1997

Foil 33 More on Arrays -- Properties and Multidimensions

From JavaScript Tutorial for CPS616 Technologies of the Information Age 1997 Basic Information Track of CPS -- Spring Semester 97. by Geoffrey C. Fox * Important Information in IMAGE
Addon
Note one can easily define and use multidimensional arrays as in syntax
  • listofmenus[0].options[0]='Admin';
  • var currentworld = 0;
  • listofmenus[currentworld].options[1]='FoilWorld'; // etc.
Arrays (the new ones!) have some interesting methods
  • MyArray.sort(sortmethod) returns list sorted in fashion determined by optional argument sortmethod (a user function comparing two elements)
  • MyArray.join(separator) returns a string of the MyArray elements separated by the character string separator
  • MyArray.reverse() reverses order in Array
MyArray = new Array(Initialsize,value0,value1, ...); // can specify an initialsize and initial values at the user's pleasure. These arguments are opitional and undefined initial values are set to null



Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat May 24 1997