Module: arrays

Methods

(static) arrays.distinct(array) → {Array.<(string|number)>}

Removes undefined elements from an array of strings or numbers and returns distinct values. This function does not preserve the elements order.

Parameters:
Name Type Description
array Array.<(string|number)>

an array of strings.

Source:
Returns:

an array of distinct strings.

Type
Array.<(string|number)>

(static) arrays.distinctObjects(array) → {Array.<Object>}

Removes undefined elements from an array of objects and return distinct objects i.e. unique by all properties. This function does not preserve the elements order.

Parameters:
Name Type Description
array Array.<Object>

an array of objects.

Source:
Returns:

an array of distinct objects.

Type
Array.<Object>

(static) arrays.intersect(array1, array2) → {Array.<(string|number)>}

Computes the intersection of two arrays of strings or numbers.

Parameters:
Name Type Description
array1 Array.<(string|number)>

the first array.

array2 Array.<(string|number)>

the second array.

Source:
Returns:

the intersection of the two arrays.

Type
Array.<(string|number)>