glize/utils/array

Methods

(static) contains(arrnon-null, element) → {boolean}

Checks if array contains the given element.
Source:
Parameters:
Name Type Description
arr Array The array to test for the presence of the element.
element * The element to search.
Returns:
Type:
boolean
Returns true if element is present.

(static) random(obj) → {*}

Gets random element from array.
Source:
Parameters:
Name Type Description
obj Arguments | Array | NodeList | string The array-like object.
Returns:
Type:
*
Returns random element from array obj.

(static) toArray(obj) → (non-null) {Array}

Converts object obj to Array.
Source:
Parameters:
Name Type Description
obj Arguments | Array | NodeList | string The array-like object.
Returns:
Type:
Array
Returns obj converted to Array.