O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Array Class to Create Arrays

Arrays are programming constructs that can hold a set of data items that you access item by item with a numeric index. Arrays are perfect for programming because, using the array index, you can reach each item in the array. So, you can easily iterate over every item in the array using a loop.

To create arrays, you use the JavaScript Array class. You can find the methods of this class in Table 6-5 and the methods of the JScript Array class in Table 6-6.

Table 6-5. Methods of the JavaScript Array Class
concat join pop push
reverse shift slice splice
sort toSource toString unshift
valueOf    
Table 6-6. Methods of the JScript Array Class
concat join reverse slice
sort toString valueOf  

Let's see an example to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required