Vector class, available in: Global contextVector is a 1-dimensional array indexed by an integer value (starting from 0). Multidimensional arrays can be simulated by putting other Vector objects into a Vector.
Examples:
    var v1=Vector.new();
    v1.add(123);
    v1.add("string");
A short way of doing the same (square brackets create a vector):
    var v2=[123,"string"];
Simulate a 2D array:
    var v3=[[1,2,3],[4,5],[6]];
You can iterate directly over values of a Vector using for(...in...) loops:
    for(var element in v3) Simulator.print(element);
This class has 15 members:
sdleiF
untyped avg ROAverage
object iterator ROIterator
int size ROElement count
untyped stdev ROStandard deviation=sqrt(sum((element[i]-avg)^2)/(size-1)) which is estimated population std.dev. from sample std.dev.
string toString ROTextual form
snoitcnuF
function add(untyped value)doesn't return a valueAppend at the end
function clear()doesn't return a valueClear data
function clone RO()returns VectorCreate a cloneThe resulting clone is a shallow copy (contains the same object references as the original). A deep copy can be obtained through serialization: String.deserialize(String.serialize(object));
function find RO(untyped value)returns intFindreturns the element index or -1 if not found
function get RO(int position)returns untypedGet value at positionobject[position] can be always used instead of object.get(position)
function insert(int position, untyped value)doesn't return a valueInsert value at position
function new()returns VectorCreate new Vector
function remove(int position)doesn't return a valueRemove at position
function set(int position, untyped value)doesn't return a valueSet value at positionobject[position]=value can be always used instead of object.set(position,value)
function sort(FunctionReference comparator)doesn't return a valueSort elements (in place)comparator can be null, giving the "natural" sorting order (depending on element type), otherwise it must be a function reference obtained from the 'function' operator.

Example:
function compareLastDigit(a,b) {return (a%10)<(b%10);}
var v=[16,23,35,42,54,61];
v.sort(function compareLastDigit);
Global context