Array

Extensions to the native JavaScript Array class.

Credits

Partially based on MooTools, My Object Oriented Javascript Tools.  Copyright © 2006-2007 Valerio Proietti, http://mad4milk.net, MIT Style License.  Partially based on Prototype JavaScript framework, version 1.6.0 © 2005-2007 Sam Stephenson.  Prototype is freely distributable under the terms of an MIT-style license.  For details, see the Prototype web site: http://www.prototypejs.org/

Summary
ArrayExtensions to the native JavaScript Array class.
Functions
forEachExecutes a provided function once per array element.
filterCreates a new array with all elements that pass the test implemented by the provided function.
mapCreates a new array with the results of calling a provided function on every element in this array.
everyTests whether all elements in the array pass the test implemented by the provided function.
someTests whether some element in the array passes the test implemented by the provided function.
indexOfReturns the first index at which a given element can be found in the array, or -1 if it is not present.
normalizeNot documented
equalsTest wether the array equals to the one passed as parameter.
detectNot documented

Functions

forEach

forEach: function(fn,
bind)

Executes a provided function once per array element.

Notes

Javascript 1.6 method

See also

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:forEach

filter

filter: function(fn,
bind)

Creates a new array with all elements that pass the test implemented by the provided function.

Notes

Javascript 1.6 method

See also

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:filter

map

map: function(fn,
bind)

Creates a new array with the results of calling a provided function on every element in this array.

Notes

Javascript 1.6 method

See also

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:map

every

every: function(fn,
bind)

Tests whether all elements in the array pass the test implemented by the provided function.

Notes

Javascript 1.6 method

See also

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:every

some

some: function(fn,
bind)

Tests whether some element in the array passes the test implemented by the provided function.

Notes

Javascript 1.6 method

See also

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:some

indexOf

indexOf: function(item,
from)

Returns the first index at which a given element can be found in the array, or -1 if it is not present.

Notes

Javascript 1.6 method

See also

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf

normalize

normalize: function(sum)

Not documented

Notes

  • needed for compatibility with a third-party UWA implementation

equals

equals: function(compare)

Test wether the array equals to the one passed as parameter.

Notes

  • needed for compatibility with a third-party UWA implementation

detect

detect: function(iterator)

Not documented

Notes

  • needed for compatibility with the TabView Control
  • needed for compatibility with the multiplefeeds native widget
forEach: function(fn,
bind)
Executes a provided function once per array element.
filter: function(fn,
bind)
Creates a new array with all elements that pass the test implemented by the provided function.
map: function(fn,
bind)
Creates a new array with the results of calling a provided function on every element in this array.
every: function(fn,
bind)
Tests whether all elements in the array pass the test implemented by the provided function.
some: function(fn,
bind)
Tests whether some element in the array passes the test implemented by the provided function.
indexOf: function(item,
from)
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
normalize: function(sum)
Not documented
equals: function(compare)
Test wether the array equals to the one passed as parameter.
detect: function(iterator)
Not documented