Namespace: ArrayManipula

ArrayManipula

Source:

Methods

(static) groupby(arr, property, optsopt) → {Object}

group elements of array by property

.

group elements of array by property

Parameters:
Name Type Attributes Description
arr Array

source array of objects

property String

property for grouping

opts Object <optional>

options

Properties
Name Type Description
defProp String

group by defProp if no property

getValue function

extract function -> (el, property) => { }

Source:
Returns:
Type
Object

(static) indexby(arr, property, optsopt) → {Object}

build index on array elements by property

.

build index on array elements by property

Parameters:
Name Type Attributes Description
arr Array

source array of objects

property String

property for index

opts Object <optional>

options

Properties
Name Type Description
emptyProp String

group by emptyProp if no property

getValue function

extract function -> (el, property) => { }

Source:
Returns:
Type
Object