API Docs for: v2.1.0
Show:

UTIL_ARRAY Class

Module: Util

Utils methods extending the Array prototype

Methods

Array.prototype.average

() Number

Compute and return the average of all the elements in this array

Returns:

Array.prototype.clear

()

Empty the array

Array.prototype.clone

() Array

Return a clone of this array. All references will be passed as is. So a change on an object of the cloned array will also visible on this one.

Returns:

Array.prototype.contains

(
  • item
)
Boolean

Checks whether the specified elements exists in the array or not

Parameters:

Returns:

Array.prototype.copy

() Array

Return a copy of the array. If an item on this object encapsulates the "copy" method, this one will be called to avoid references issues

Returns:

Array.prototype.isEmpty

() Boolean

Check if the array is empty

Returns:

Boolean:

true if the array is empty

Array.prototype.pop

()

Remove the item at the end of this array

Array.prototype.sum

() Number

Compute and return the sum of all elements in this array

Returns:

Array.prototype.unique

() Array

Removes doubles elements from the array

Returns:

Array.prototype.without

(
  • item
)

Remove all the occurrences of the item from the array

Parameters:

cgsgIsArray

(
  • value
)
Boolean

Parameters:

Returns: