JavaScript Editor Free JavaScript Editor     JavaScript Debugger 




Main Page

Previous Page
Next Page

15.4. Collections

As you probably noticed in Table 15-1, there is an interface whose sole purpose is to deal with collections. Add to this the various collections defined in Tables 15-2 and 15-3, and it becomes apparent very quickly that somebody really likes collections. Who can blame them?

Collections make for very compact code that can be stepped through in a sequential manner. Table 15-4 details the single property and two methods available through the collection interface.

Table 15-4. The Property and the Methods Available Through the Collection Interface

Property/Method

Description

length

The number of items in the collection

item()

Retrieves an individual item from a collection based upon that item's index

namedItem()

Retrieves an individual item from a collection based upon that item's identifier



Previous Page
Next Page




JavaScript Editor Free JavaScript Editor     JavaScript Debugger


©