Class: Array

Array()

new Array()

Source:

Methods

asEntries()

Returns all own properties of an object as an Array of name<->value pairs
Source:

contains(b) → {boolean}

Checks if an array contains the given parameter
Parameters:
Name Type Description
b Object Value to search for
Source:
Returns:
Type
boolean

distinct(serialize) → {Array}

Returns all distinct values of an array
Parameters:
Name Type Description
serialize boolean If set will return distinct JSON-serialized (deserialized again after distinct)
Source:
Returns:
Type
Array

getFirst(filter, default) → {Object|undefined}

Returns the first element of an array with optional filtering and default value
Parameters:
Name Type Description
filter function Optional callback to filter the array with before returning the first entry
default Object Optional return value if no entry in result.
Source:
Returns:
Type
Object | undefined

getLast(filter, default) → {Object|undefined}

Returns the last element of an array with optional filtering and default value
Parameters:
Name Type Description
filter function Optional callback to filter the array with before returning the last entry
default Object Optional return value if no entry in result.
Source:
Returns:
Type
Object | undefined

groupBy(grouper1, grouper2, grouperN) → {Object}

Groups an array into a nested tree meaning for each param the array that would be an array turns itself into a value:results dictionary
Parameters:
Name Type Description
grouper1 function | string Either a callback to be used for grouping or the name of a field
grouper2 function | string Either a callback to be used for grouping or the name of a field to be performed on each result of grouper1
grouperN function | string Either a callback to be used for grouping or the name of a field to be performed on each result of previous grouper
Source:
Returns:
Type
Object

joinLeft(secondArray, matcher) → {Array}

Returns an array containing array with 0 being the item of this that was matches and 1 being an array of all entries of arr that returned true when passed to match
Parameters:
Name Type Description
secondArray Array Array to be joined
matcher function A callback to be called with each line of self (with params(selfLine,secondArrayLine)) to determine a match
Source:
Returns:
Type
Array

max() → {number}

Returns the highest value in the array
Source:
Returns:
Type
number

min() → {number}

Returns the lowest value in the array
Source:
Returns:
Type
number

sum() → {number}

Returns the sum of all numbers in the array
Source:
Returns:
Type
number

toXlsx(nameopt) → {PlainZip}

Returns an XLSX PlainZip with the given name containing a single sheet with the current Array interpreted as 2D string array as content
Parameters:
Name Type Attributes Description
name string <optional>
Name of the file to be offered for download. Defaults to a GUID otherwise.
Source:
Returns:
Type
PlainZip