About Pi Downloads Documentation Plugins Developer Forum Issues

pi.util.Array2009-01-06 09:23:27

Summary

pi.util.Array, contains a few powerful functions for arrays.

Methods

clone pi.util.Array.clone(array,shallow (Optional))
Duplicates the array.
count pi.util.Array.count(array,value)
Return the number of times given value appers in the array.
forEach pi.util.Array.forEach(array,function)
Executes a provided function once per array element.
getLatest pi.util.Array.getLatest(array)
Return latest item of specified array.
indexOf pi.util.Array.indexOf(array,value)
Return the first index at which a given element can be found in the array, or -1 if it is not present.
remove pi.util.Array.remove(array,value)
Remove the item at the given index in the array, and return new length.
rotate pi.util.Array.rotate(array,value)
Rotates array elements by given value.