UTIL_ARRAY Class
Utils methods extending the Array prototype
Item Index
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
(
Boolean
-
item
Checks whether the specified elements exists in the array or not
Parameters:
-
item
Object
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.without
(
-
item
Remove all the occurrences of the item from the array
Parameters:
-
item
Object