Module ringo/utils/arrays
Provides utility functions for working with JavaScript Arrays.
check if an array passed as argument contains
a specific value (start from end of array)
Parameters
| Object |
val |
the value to check |
Returns
| boolean |
true if the value is contained |
Retrieve the intersection set of a bunch of arrays
Parameters
| Array |
array1,... |
the arrays to intersect |
Returns
| Array |
the intersection set |
max
(array)
Returns
|
the maximal element in an array obtained by calling Math.max(). |
min
(array)
Returns
|
the minimal element in an array obtained by calling Math.min(). |
Return the last element of this array. This is like pop(), but
without modifying the array.
Returns
| Object |
the last element of the array, or undefined if the array is empty. |
Remove the first occurrence of the argument value from this array. This method
mutates and returns the array on which it is called and does not create a
new array instance.
Parameters
| Object |
val |
the value to remove |
union
(array1,...)
Retrieve the union set of a bunch of arrays
Parameters
| Array |
array1,... |
the arrays to unify |