Array helper libraries
- Source:
Classes
Members
(static, constant) add
Functions for adding values to arrays in different ways.
- Source:
Methods
(static) containsAll(list, …items) → {boolean}
See if a list contains all of the specified items.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
list |
object | A |
|
items |
any |
<repeatable> |
- Source:
Returns:
- Type
- boolean
(static) containsAny(list, …items) → {boolean}
See if an list object contains any of the specified items.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
list |
object | A |
|
items |
any |
<repeatable> |
- Source:
Returns:
- Type
- boolean
(static) powerset(array) → {Array}
Return a Powerset of values in the array.
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | The array to make the powerset from. |
- Source:
Returns:
The powerset.
- Type
- Array
(static) random(array) → {mixed}
Get a random element from an array.
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | The array to get an item from. |
- Source:
Returns:
The randomly selected item.
- Type
- mixed
(static) removeItems(list, …items) → {number}
Remove items from a list object.
Passed any number of items, it will see if any of those items are found in the array, and if they are, will remove them from the array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
list |
object | A |
|
items |
any |
<repeatable> |
- Source:
Returns:
Number of items actually removed.
- Type
- number