Was this article helpful?

Collection

Last modified 12:05, 11 Apr 2013
Table of Contents

Description

This object represents a collection of other Gigya objects. It has member functions that perform operations on the entire collection or return individual items from it.

Member Methods

Method Name
Return Value Description
asArray() Array Returns the collection as an array of the contained objects.
each(function(item, index)) None

This function accepts a function reference as a parameter and calls that function on each item in the collection. The called function receives one item from the collection and the index of the item (zero based) as parameters.
For example, the following code will print each item in the collection col:

function print(item, index) {
    document.write("index="+index+" item="+item);
}
col.each(print);
getById(itemID) object Returns an item from the collection by its ID.
getSize() number Returns the number of items in the collection.

Tags

This page has no custom tags set.

Comments

You must to post a comment.

Attachments