Skip to main content
A newer version of this page is available. .

Collection<T> Class

Serves as a base for classes maintaining a collection of items.

Declaration

export abstract class Collection<T>

Type Parameters

Name Description
T

An individual collection item.

Properties

count Property

Gets the number of items contained in the collection.

Declaration

readonly count: number

Property Value

Type Description
number

The number of items.

Methods

getByIndex(index) Method

Gets an item with the specified index.

Declaration

getByIndex(
    index: number
): T

Parameters

Name Type Description
index number

The index of an item in the collection.

Returns

Type Description
T

An object that is the item at the specified index.