EventCategories Type

The EventCategories data type represents a collection of EventCategory items.

It is possible to retrieve a specific element by specifying its index in square brackets and obtain the number of elements in the collection with the method length. It is also possible to obtain the corresponding array with the method toArray.

Error Handling

Errors can occur in case:

  • The specified position is out of range or is not a positive integer.
  • The category ID is not defined in the text group: Category
  • The category ID is not a positive integer

Examples of Use

 

var categories = getEventCategories();

var count = categories.length;

var lastCategory = categories[count - 1];

var categoryArray = categories.toArray();

 

Where:

  • categories is an EventCategories object.
  • lastCategory is an EventCategory object.
  • categoryArray is an array of EventCategory objects, on which it is possible to invoke all the methods that operate on arrays in Javascript.