-
Notifications
You must be signed in to change notification settings - Fork 1
Array
Jump To | Go Back |
Arguments | Methods | Variables |
---|
Implements: None
A wrapper for primitive arrays and an interface for building more complex ones.
array = new Array( 10, 0 );
array = new Array( [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] );
Name | Type | Purpose |
---|---|---|
array/size | undef |
{mixed} Either the starting array to use, or the size of the array to create. |
default | undef |
{mixed} optional: if provided, will fill the newly created array. Default: undefined
|
Jump To | top |
sort | unique | concat | difference | union | contains | set | get | resize |
---|---|---|---|---|---|---|---|---|---|---|
toArray | toString | is |
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Used as a template interface for constructors that inherit Array
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Returns an array containing all of the unique elements in the array.
Returns: array ([values...]
)
Name | Type | Purpose |
---|---|---|
target | array |
The array to combine |
Returns an array containing all the elements from both arrays..
Returns: array ([values...]
)
Name | Type | Purpose |
---|---|---|
target | array |
The array to subtract |
Returns an array containing every element not in the provided array.
Returns: array ([values...]
)
Name | Type | Purpose |
---|---|---|
target | array |
The array to union with |
Returns an array containing all of the unique elements between both arrays.
Returns: int (0..
)
Name | Type | Purpose |
---|---|---|
value | mixed |
The value to search for |
Return the first index which contains value
, or -1 if it wasn't found.
Returns: value
Name | Type | Purpose |
---|---|---|
index | int |
The index to set |
value | mixed |
The value to assign |
Used to set an element in the array.
Returns: Mixed
Name | Type | Purpose |
---|---|---|
index | int |
The index to retrieve |
Used to get an element from the array.
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
size | int |
The new size for the array |
default | mixed |
optional: the value the array any new elements will be populated with. Default is undefined
|
Returns: array ([values...]
)
Name | Type | Purpose |
---|---|---|
None |
Returns the structure as a array.
Returns: string ("string"
)
Name | Type | Purpose |
---|---|---|
divider | string |
optional: The divider between each element. Default: ", " |
Returns a comma-separated string(by default) of all values in the array.
Returns: boolean (true
or false
)
Name | Type | Purpose |
---|---|---|
type | Constructor |
The Constructor to compare this against. |
Returns true
if the provided type is Array.
Jump To | top |
---|
- content - The internal array.
Devon Mullane 2020