Pokemon3D Script API Documentation

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 constructor
Takes any number of arguments, types can be mixed.

Arguments: [any[] ...args]Usage: var a = new Array([...args]);

Variables

-- No Variables --

Getters & Setters

Getter (get) length
Gets the amount of items in the array.

Type: intUsage: var length = a.length;

Methods

all
Returns whether all items in the array conform to a constraint.

Return: boolArguments: function constraintUsage: var result = a.all(constraint);

any
If the array contains any items matching the search.

Signatures:
Return: boolUsage: var result = a.any();

Return: boolArguments: function comparerUsage: var result = a.any(comparer);

count
Returns the amount of items in the array that match the search.

Signatures:
Return: intUsage: var result = a.count();

Return: intArguments: function comparerUsage: var result = a.count(comparer);

first
Returns the first item in the array that matches the search or undefined for no match.

Signatures:
Return: anyUsage: var result = a.first();

Return: anyArguments: function comparerUsage: var result = a.first(comparer);

includes
Determines whether the array includes an item.
Comparer example:
a.includes(item, (a, b) => { a.id == b.id; });

Signatures:
Return: boolArguments: any itemUsage: var result = a.includes(item);

Return: boolArguments: any item, function comparerUsage: var result = a.includes(item, comparer);

last
Returns the last item in the array that matches the search or undefined for no match.

Signatures:
Return: anyUsage: var result = a.last();

Return: anyArguments: function comparerUsage: var result = a.last(comparer);

pop
Removes the last item from the array and returns it.

Return: anyUsage: var result = a.pop();

push
Adds items to the end of the array.

Return: voidArguments: any[] ...itemsUsage: a.push(...items);

select
Transforms all elements of the array with a transformation function.

Return: any[]Arguments: function transformerUsage: var result = a.select(transformer);

single
Finds a single item within the array and returns it.

Signatures:
Return: anyUsage: var result = a.single();

Return: anyArguments: function comparerUsage: var result = a.single(comparer);

where
Filters the array with the given search.

Return: any[]Arguments: function filterUsage: var result = a.where(filter);

Indexers

Indexer (get) indexer
Returns the item in the array at index position.

Return: anyArguments: int indexUsage: var result = a[index];

Indexer (set) indexer
Overwrites the item in the array at index position.

Arguments: int indexUsage: a[index] = value;