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
constructorTakes any number of arguments, types can be mixed.
Variables
-- No Variables --
Getters & Setters
Methods
allReturns whether all items in the array conform to a constraint.
anyIf the array contains any items matching the search.
Signatures:
Return: boolUsage: var result = a.any();
countReturns the amount of items in the array that match the search.
Signatures:
Return: intUsage: var result = a.count();
firstReturns the first item in the array that matches the search or undefined for no match.
Signatures:
Return: anyUsage: var result = a.first();
includesDetermines whether the array includes an item.
Comparer example:
a.includes(item, (a, b) => { a.id == b.id; });Signatures:
lastReturns the last item in the array that matches the search or undefined for no match.
Signatures:
Return: anyUsage: var result = a.last();
popRemoves the last item from the array and returns it.
Return: anyUsage: var result = a.pop();
pushAdds items to the end of the array.
selectTransforms all elements of the array with a transformation function.
singleFinds a single item within the array and returns it.
Signatures:
Return: anyUsage: var result = a.single();
whereFilters the array with the given search.
Pokemon3D Script API Documentation
Articles