Array
API documention for the Prototype Array.
Prototype for the primitve array[] type.
Source code
Usage
var instance = new Array(args);
...
instance.method(args);
Index
Constructor
constructor
Takes any number of arguments, types can be mixed.
Takes any number of arguments, types can be mixed.
Variables
-- No Variables --
Getters & Setters
Methods
all
Returns whether all items in the array conform to a constraint.
any
If the array contains any items matching the search.
Signatures:
count
Returns the amount of items in the array that match the search.
Signatures:
first
Returns the first item in the array that matches the search or undefined for no match.
Signatures:
includes
Determines whether the array includes an item.
Comparer example:
Signatures:
last
Returns the last item in the array that matches the search or undefined for no match.
Signatures:
pop
Removes the last item from the array and returns it.
push
Adds items to the end of the array.
select
Transforms all elements of the array with a transformation function.
single
Finds a single item within the array and returns it.
Signatures:
where
Filters the array with the given search.
Returns whether all items in the array conform to a constraint.
any
If the array contains any items matching the search.
Signatures:
Return: bool
Usage: var result = a.any();
count
Returns the amount of items in the array that match the search.
Signatures:
Return: int
Usage: var result = a.count();
first
Returns the first item in the array that matches the search or undefined for no match.
Signatures:
Return: any
Usage: var result = a.first();
includes
Determines whether the array includes an item.
Comparer example:
a.includes(item, (a, b) => { a.id == b.id; });
Signatures:
last
Returns the last item in the array that matches the search or undefined for no match.
Signatures:
Return: any
Usage: var result = a.last();
pop
Removes the last item from the array and returns it.
Return: any
Usage: var result = a.pop();
push
Adds items to the end of the array.
select
Transforms all elements of the array with a transformation function.
single
Finds a single item within the array and returns it.
Signatures:
Return: any
Usage: var result = a.single();
where
Filters the array with the given search.