STAY IN TOUCH

and receive our newsletter to get the latest news and tips.


Collection

A collection of objects
function (Collection) → add(item : T)
Adds an object
function (Collection) → add many(items : Collection)
Adds many objects at once
function (Collection) → at(index : Number) returns T
Gets the object at position index. Returns invalid if index is out of range
function (Collection) → avg returns Number
Computes the average of the values
function (Collection) → avg of(key : Number Converter from T) returns Number
Computes the average of the key of the elements in the collection
function (Collection) → clear
Removes all objects from the collection
function (Collection) → contains(item : T) returns Boolean
Checks if the item is in the collection
function (Collection) → continuation returns String
Gets the identifier of the next set of items (if any)
function (Collection) → count returns Number
Gets the number of objects.
function (Collection) → first returns T
Gets the first element if any
function (Collection) → from json(jobj : Json Object)
Imports a JSON representation of the contents.
function (Collection) → index of(item : T, start : Number) returns Number
Gets the index of the first occurrence of an object. Returns -1 if not found or start is out of range.
function (Collection) → insert at(index : Number, item : T)
Inserts an object at position index. Does nothing if index is out of range.
function (Collection) → is invalid returns Boolean
Returns true if the current instance is useless
function (Collection) → join(separator : String) returns String
Concatenates the separator and items into a string
function (Collection) → last returns T
Gets the last element if any
function (Collection) → map to returns Unfinished Type
Applies converter on all elements of the input collection and returns a collection of results
function (Collection) → max returns Number
Computes the maximum of the values
function (Collection) → max of(key : Number Converter from T) returns Number
Computes the maximum of the key of the elements in the collection
function (Collection) → min returns Number
Computes the minimum of the values
function (Collection) → min of(key : Number Converter from T) returns Number
Computes the minimum of the key of the elements in the collection
function (Collection) → ordered by(key : Number Converter from T) returns Collection
Returns a collection sorted using specified comparison key
function (Collection) → ordered by string(key : String Converter from T) returns Collection
Returns a collection sorted using specified comparison key
function (Collection) → pick entry(text : String) returns T
Ask user to pick an entry from this collection
function (Collection) → post to wall
Display all objects on the wall
function (Collection) → random returns T
Gets a random object from the collection. Returns invalid if the collection is empty.
function (Collection) → remove(item : T) returns Boolean
Removes the first occurence of an object. Returns true if removed.
function (Collection) → remove at(index : Number)
Removes the object at position index.
function (Collection) → reverse
Reverses the order of objects in the collection
function (Collection) → set at(index : Number, item : T)
Sets the object at position index. Does nothing if the index is out of range.
function (Collection) → set continuation(value : String)
Sets the identifier of the next set of items
function (Collection) → slice(start : Number, end : Number) returns Collection
Returns a slice of the collection starting at start, and ends at, but does not include, the end.
function (Collection) → sort
Sorts the strings in this collection
function (Collection) → sort by date
Sorts from the newest to oldest
function (Collection) → sort by distance(loc : Location)
Sorts the places by distance to the location
function (Collection) → sorted(comparison : Comparison of T) returns Collection
Returns a collection sorted using specified comparison function
function (Collection) → sum returns Number
Computes the sum of the values
function (Collection) → sum of(key : Number Converter from T) returns Number
Computes the sum of the key of the elements in the collection
function (Collection) → take(count : Number) returns Collection
Returns a collection with the count first elements if any.
function (Collection) → to json returns Json Object
Exports a JSON representation of the contents.
function (Collection) → where(condition : Predicate on T) returns Collection
Returns a collections of elements that satisfy the filter condition

edit this topic xntvjueifa