Array

Namespace

Array

Source:

Methods

absorb(arr) → {Array}

Description:
  • Absorb (push) every item of given array to this Array
Source:
Parameters:
Name Type Description
arr Array Array to be absorbed
Returns:
this
Type
Array

clone() → {Array}

Description:
  • Clone this Array
Source:
Returns:
Clone of this Array
Type
Array

diff(arr) → {Array}

Description:
  • Returns the difference between this Array and given in argument
Source:
Parameters:
Name Type Description
arr Array Array to compare
Returns:
Array with elements that are different
Type
Array

empty() → {Array}

Description:
  • Empty this Array
Source:
Returns:
this
Type
Array

filterLike(query) → {Array}

Description:
  • Returns the new array based on current one by filtering according to query
Source:
See:
  • Object#isLike
Parameters:
Name Type Description
query Object Query
Returns:
New Array with matching elements
Type
Array

lookFor(query) → {number}

Description:
  • Look for index of item matching to query
Source:
Parameters:
Name Type Description
query Object Query
Returns:
Index of matching index; -1 if not found
Type
number

shuffle() → {Array}

Description:
  • Shuffle this Array
Source:
Returns:
this
Type
Array

unique() → {Array}

Description:
  • Unique this Array - remove all duplicate items
Source:
Returns:
this
Type
Array

(static) deepCloneArrayOfObjects(arr) → {Array.<Object>}

Description:
  • Deep clone array of object
Source:
Parameters:
Name Type Description
arr Array of objects
Returns:
Clone of arr
Type
Array.<Object>

(static) isEmpty(arr) → {boolean}

Description:
  • Checks is given value is Array and is empty
Source:
Parameters:
Name Type Description
arr Array Something to check
Returns:
Verdict
Type
boolean

(static) isInvalidOrEmpty(arr) → {boolean}

Description:
  • Checks is given value isn't Array or is empty
Source:
Parameters:
Name Type Description
arr Array Something to check
Returns:
Verdict
Type
boolean

(static) isNotEmpty(arr) → {boolean}

Description:
  • Checks is given value is Array and is non-empty
Source:
Parameters:
Name Type Description
arr Array Something to check
Returns:
Verdict
Type
boolean

(static) sortArrayOfObjects(arr, propertyName, descendingopt)

Description:
  • Sort array of objects
Source:
Parameters:
Name Type Attributes Default Description
arr Array.<Object> Array of objects that should be sorted
propertyName string Name of property by which sorting will be done
descending boolean <optional>
false Flag to sort in descending order

(static) wrap(something) → {Array}

Description:
  • Wrap in Array if @param is not an Array already
Source:
Parameters:
Name Type Description
something * | Array Something that should be an Array
Returns:
Type
Array