Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
636
JavaScript Arrays
Introduction
Arrays are variables, which can contain multiple values. The
difference is that it is only “one” array, which will store these values. If
you needed to store multiple values in normal variables, then you would have to
define multiple variables. Usually arrays are associated with numbers, which
starts with 0. If you create an array for 4 elements, then the first one will
be 0, the second 1, the third 2 and so on. Arrays are created always with the
new keyword. Arrays are useful if are for example creating a calendar. You
could store the months in an array.
Assigning Values
The values can be assigned in two ways. Either without
defining the size and index or by defining the size and index number. The
following creates two arrays with each 12 elements.
var arCalendarMonths = new Array("January",
"February", "March", "April", "May",
"April", "June", "July", "August",
"September", "October", "November",
"December")
The Array object contains total 10 functions. We have
grouped all 10 functions together in a new page with each an example and a
screenshot. Please visit that page for more information about the functions.