Easier manipulation of arrays
Here is a nice collection of functions which allow you to drop and insert elements in an array where you want and by the criteria you want. Especially associative arrays are now much easier to handle. A special feature are the pointer functions which let you walk through an array without forgetting where you have been in it at your last made step.
Deletes an element at an array index of your choice. This is easier and more flexible than standard functions like .pop(), .shift() or .slice(). Returns the modificated array.
Deletes an element by value instead of deleting it by index. All elements containing value are affected. Returns the modificated array.
Inserts a new element at index i, containing the value "val".
Returns whether the array contains an element containing the passed value. Usage example: if(myList.contains("Herbert"))... Not for associative arrays.
Returns the index of the first element containing value.
Gets the average value of all numbers in the array.
Although associative arrays officially don't work with indexes, this function informs you about the value which is saved at the passed index, solely based on the chronological order which the values of the associative array have been saved with.
The same as .getValueAtPoint(index), providing the key name instead of the value.
Returns the number of elements in an associative array.
Returns the key of the highest value in an array or object
Returns the key of the lowest value in an array or object
valuesort(toBeSorted [, -1])
Sorts an array (value) by value. The optional argument -1 lets the array be sorted setting the highest value as first element and the lowest value as the last element.
Sorts an assoiciative array by its key names.
Checks if var is a real array already containing elements.
Lets you walk step by step through an array, returning the value of each next element, beginning with index 0. Each time the function is used, its pointer is set on the next index. Returns null after passing the last element.
Lets the pointer of .getNext() jump to next.
Like .getNext(), but always returning the next previous element.
Gets the current element without changing the pointer.
Checks if val is an array or not.
In order to use these extra functions, simply download the free Turboid framework and put it into the directory of your HTML file, then write this line into the head section of your HTML file, and that's it: