Class: Collection

Collection

new Collection()

Represents basic functionality for Kraken data sets.
Source:

Methods

add(objectToAdd)

Adds object or array to collection.
Parameters:
Name Type Description
objectToAdd Object | Array Object or array to add to collection.
Source:

each(functionToApply)

Applies function to every element in collection.
Parameters:
Name Type Description
functionToApply Function to apply to elements.
Source:

get(index)

Retrieves collection item by index.
Parameters:
Name Type Description
index Number Index of object to retrieve from collection.
Source:

reset()

Resets data.
Source:

toArray()

Returns data as array.
Source:

where(filter)

Returns all records which matches conditionalObject. For example if it is {a: 1} - method will return only objects from collection where 'a' property is present and is equal to 1
Parameters:
Name Type Description
filter Object Filter descriptor object.
Source: