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.
concat | join | pop | push |
reverse | shift | slice | splice |
sort | toSource | toString | unshift |
valueOf |
concat | join | reverse | slice |
sort | toString | valueOf |
Let's see an example to ...
Get Real World XML now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.