Array.html revision eb9b6f817df5c660be9f00fc5d27fe33479fdc98
7380653a55868892cb97060c61641fc73ba22cbeDav Glass<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
7380653a55868892cb97060c61641fc73ba22cbeDav Glass <link rel="stylesheet" type="text/css" href="assets/api.css">
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <script type="text/javascript" src="assets/api-js"></script>
7380653a55868892cb97060c61641fc73ba22cbeDav Glass <script type="text/javascript" src="assets/ac-js"></script>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <h3>yui <span class="subtitle">3.00PR1</span></h3>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> Show Private</span>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> Show Protected</span>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <span id="classopts"><input type="checkbox" name="showdeprecated" id="showdeprecated" /> Show Deprecated</span>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <!-- class tree goes here -->
7380653a55868892cb97060c61641fc73ba22cbeDav Glass Y.Array(o) returns an array:
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove- Arrays are return unmodified unless the start position is specified.
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove- "Array-like" collections (@see Array.test) are converted to arrays
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove- For everything else, a new array is created with the input as the sole item
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove- The start position is used if the input is or is like an array to return
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grovea subset of the collection.
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <object>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove the item to arrayify
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove if an array or array-like, this is the start index
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <boolean>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove if true, it forces the array-like fork. This
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grovecan be used to avoid multiple array.test calls.
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove Executes the supplied function on each item in the array.
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <dt>Returns:
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove Returns an object using the first array as keys, and
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grovethe second as values. If the second array is not
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Groveprovided the value is set to true for each.
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove optional valueset
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <dt>Returns:
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove Returns the index of the first item in the array
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grovethat contains the specified value, -1 if the
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grovevalue isn't found.
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove the array to search
9271f9c6e942b68a4fbfa228f67ab46b72c76780Ryan Grove the value to search for
9271f9c6e942b68a4fbfa228f67ab46b72c76780Ryan Grove <dt>Returns:
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <dd>the index of the item that contains the value or -1</dd>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove Evaluates the input to determine if it is an array, array-like, or
7380653a55868892cb97060c61641fc73ba22cbeDav Glasssomething else. This is used to handle the arguments collection
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Groveavailable within functions, and HTMLElement collections
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass <dt>Returns:
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <dd>a number indicating the results:
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove0: Not an array or an array-like collection
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove1: A real array.
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove2: array-like collection.</dd>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_anim.html">anim</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_anim-color.html">anim-color</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_anim-curve.html">anim-curve</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_anim-easing.html">anim-easing</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_anim-scroll.html">anim-scroll</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_anim-xy.html">anim-xy</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_attribute.html">attribute</a></li>
b5276e211acea576c3d3edc6aaccd94a8fc4402aRyan Grove <li class=""><a href="module_base.html">base</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_dd-plugin.html">dd-plugin</a></li>
b5276e211acea576c3d3edc6aaccd94a8fc4402aRyan Grove <li class=""><a href="module_event.html">event</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_get.html">get</a></li>
7380653a55868892cb97060c61641fc73ba22cbeDav Glass <li class=""><a href="module_loader.html">loader</a></li>
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass <li class=""><a href="module_node.html">node</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_node-class.html">node-class</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_node-region.html">node-region</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="module_node-screen.html">node-screen</a></li>
7380653a55868892cb97060c61641fc73ba22cbeDav Glass <li class=""><a href="module_Queue.html">Queue</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class="selected"><a href="module_yui.html">yui</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class="selected"><a href="Array.html">Array</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="Object.html">Object</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-array.js.html">yui-array.js</a></li>
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass <li class=""><a href="yui-core.js.html">yui-core.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-dump.js.html">yui-dump.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-init.js.html">yui-init.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-lang.js.html">yui-lang.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-later.js.html">yui-later.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-log.js.html">yui-log.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-object.js.html">yui-object.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui-ua.js.html">yui-ua.js</a></li>
92e597e015cd0d9a07055436b637d9cfdb9c1164Ryan Grove <li class=""><a href="yui.js.html">yui.js</a></li>
b5276e211acea576c3d3edc6aaccd94a8fc4402aRyan Grove Copyright © 2008 Yahoo! Inc. All rights reserved.