UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

182 lines (168 loc) 86 kB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.array</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Namespace goog.array</h1><a class="source" href="source/lib/goog/array/array.js.src.html#l21">code &raquo;</a></header><section></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="typedefs"><h2>Type Definitions</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l56">code &raquo;</a><a class="member" name="goog.array.ArrayLike">goog.array.ArrayLike</a> : <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>|<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-536297177">NodeList</a>|<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments">Arguments</a>|{length: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>})</code></div><div>No description.</div></summary></details></div></div></section><section id="static-functions"><h2>Global Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1317">code &raquo;</a><code class="type">&lt;VALUE&gt;</code> <span class="member"><a name="goog.array.binaryInsert">goog.array.binaryInsert</a> <span class="args">( array, value, opt_compareFn )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Inserts a value into a sorted array. The array is not modified if the value is already present.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>array: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to modify.<dt>value: <code class="type">VALUE</code><dd>The object to insert.<dt>opt_compareFn: <code class="type">function(VALUE, VALUE): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Optional comparison function by which the array is ordered. Should take 2 arguments to compare, and return a negative number, zero, or a positive number depending on whether the first argument is less than, equal to, or greater than the second.</dl><tr><th>Returns<tr><td><dl>True if an element was inserted.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1339">code &raquo;</a><code class="type">&lt;VALUE&gt;</code> <span class="member"><a name="goog.array.binaryRemove">goog.array.binaryRemove</a> <span class="args">( array, value, opt_compareFn )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Removes a value from a sorted array.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>array: <code class="type">(!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|!<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to modify.<dt>value: <code class="type">VALUE</code><dd>The object to remove.<dt>opt_compareFn: <code class="type">function(VALUE, VALUE): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Optional comparison function by which the array is ordered. Should take 2 arguments to compare, and return a negative number, zero, or a positive number depending on whether the first argument is less than, equal to, or greater than the second.</dl><tr><th>Returns<tr><td><dl>True if an element was removed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1024">code &raquo;</a><code class="type">&lt;TARGET, VALUE&gt;</code> <span class="member"><a name="goog.array.binarySearch">goog.array.binarySearch</a> <span class="args">( arr, target, opt_compareFn )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Searches the specified array for the specified target using the binary search algorithm. If no opt_compareFn is specified, elements are compared using <code>goog.array.defaultCompare</code>, which compares the elements using the built in < and > operators. This will produce the expected behavior for homogeneous arrays of String(s) and Number(s). The array specified <b>must</b> be sorted in ascending order (as defined by the comparison function). If the array is not sorted, results are undefined. If the array contains multiple instances of the specified target value, any of these instances may be found. Runtime: O(log n)</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to be searched.<dt>target: <code class="type">TARGET</code><dd>The sought value.<dt>opt_compareFn: <code class="type">function(TARGET, VALUE): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Optional comparison function by which the array is ordered. Should take 2 arguments to compare, and return a negative number, zero, or a positive number depending on whether the first argument is less than, equal to, or greater than the second.</dl><tr><th>Returns<tr><td><dl>Lowest index of the target value if found, otherwise (-(insertion point) - 1). The insertion point is where the value should be inserted into arr to preserve the sorted property. Return value >= 0 iff target is found.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1091">code &raquo;</a><code class="type">&lt;THIS, VALUE, TARGET&gt;</code> <span class="member"><a name="goog.array.binarySearch_">goog.array.binarySearch_</a> <span class="args">( arr, compareFn, isEvaluator, opt_target, opt_selfObj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Implementation of a binary search algorithm which knows how to use both comparison functions and evaluators. If an evaluator is provided, will call the evaluator with the given optional data object, conforming to the interface defined in binarySelect. Otherwise, if a comparison function is provided, will call the comparison function against the given data object. This implementation purposefully does not use goog.bind or goog.partial for performance reasons. Runtime: O(log n)</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to be searched.<dt>compareFn: <code class="type">(function(TARGET, VALUE): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)</code><dd>Either an evaluator or a comparison function, as defined by binarySearch and binarySelect above.<dt>isEvaluator: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>Whether the function is an evaluator or a comparison function.<dt>opt_target: <code class="type">TARGET=</code><dd>If the function is a comparison function, then this is the target to binary search for.<dt>opt_selfObj: <code class="type">THIS=</code><dd>If the function is an evaluator, this is an optional this object for the evaluator.</dl><tr><th>Returns<tr><td><dl>Lowest index of the target value if found, otherwise (-(insertion point) - 1). The insertion point is where the value should be inserted into arr to preserve the sorted property. Return value >= 0 iff target is found.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1055">code &raquo;</a><code class="type">&lt;THIS, VALUE&gt;</code> <span class="member"><a name="goog.array.binarySelect">goog.array.binarySelect</a> <span class="args">( arr, evaluator, opt_obj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Selects an index in the specified array using the binary search algorithm. The evaluator receives an element and determines whether the desired index is before, at, or after it. The evaluator must be consistent (formally, goog.array.map(goog.array.map(arr, evaluator, opt_obj), goog.math.sign) must be monotonically non-increasing). Runtime: O(log n)</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to be searched.<dt>evaluator: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>Evaluator function that receives 3 arguments (the element, the index and the array). Should return a negative number, zero, or a positive number depending on whether the desired index is before, at, or after the element passed to it.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within evaluator.</dl><tr><th>Returns<tr><td><dl>Index of the leftmost element matched by the evaluator, if such exists; otherwise (-(insertion point) - 1). The insertion point is the index of the first element for which the evaluator returns negative, or arr.length if no such element exists. The return value is non-negative iff a match is found.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1359">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.bucket">goog.array.bucket</a> <span class="args">( array, sorter, opt_obj )</span> &rArr; <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div><p>Splits an array into disjoint buckets according to a splitting function.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>array: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;</code><dd>The array.<dt>sorter: <code class="type">function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, <a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;): ?</code><dd>Function to call for every element. This takes 3 arguments (the element, the index and the array) and must return a valid object key (a string, number, etc), or undefined, if that object should not be placed in a bucket.<dt>opt_obj: <code class="type">S=</code><dd>The object to be used as the value of 'this' within sorter.</dl><tr><th>Returns<tr><td><dl>An object, with keys being all of the unique return values of sorter, and values being arrays containing the items for which the splitter returned that key.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l623">code &raquo;</a><span class="member"><a name="goog.array.clear">goog.array.clear</a> <span class="args">( arr )</span></span></div><p>Clears the array.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>Array or array like object to clear.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l851">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.clone">goog.array.clone</a> <span class="args">( arr )</span> &rArr; <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;</code></span></div><p>Does a shallow copy of an array.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array-like object to clone.</dl><tr><th>Returns<tr><td><dl>Clone of the input array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1266">code &raquo;</a><code class="type">&lt;VALUE&gt;</code> <span class="member"><a name="goog.array.compare3">goog.array.compare3</a> <span class="args">( arr1, arr2, opt_compareFn )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>3-way array compare function.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr1: <code class="type">(!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|!<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The first array to compare.<dt>arr2: <code class="type">(!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|!<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The second array to compare.<dt>opt_compareFn: <code class="type">function(VALUE, VALUE): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Optional comparison function by which the array is to be ordered. Should take 2 arguments to compare, and return a negative number, zero, or a positive number depending on whether the first argument is less than, equal to, or greater than the second.</dl><tr><th>Returns<tr><td><dl>Negative number, zero, or a positive number depending on whether the first argument is less than, equal to, or greater than the second.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l799">code &raquo;</a><span class="member"><a name="goog.array.concat">goog.array.concat</a> <span class="args">( var_args )</span> &rArr; <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Returns a new array that is the result of joining the arguments. If arrays are passed then their items are added, however, if non-arrays are passed they will be added to the return array as is. Note that ArrayLike objects will be added as is, rather than having their items added. goog.array.concat([1, 2], [3, 4]) -> [1, 2, 3, 4] goog.array.concat(0, [1, 2]) -> [0, 1, 2] goog.array.concat([1, 2], null) -> [1, 2, null] There is bug in all current versions of IE (6, 7 and 8) where arrays created in an iframe become corrupted soon (not immediately) after the iframe is destroyed. This is common if loading data via goog.net.IframeIo, for example. This corruption only affects the concat method which will start throwing Catastrophic Errors (#-2147418113). See http://endoflow.com/scratch/corrupted-arrays.html for a test case. Internally goog.array should use this, so that all methods will continue to work on these broken array objects.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...*</code><dd>Items to concatenate. Arrays will have each item added, while primitives and objects will be added as is.</dl><tr><th>Returns<tr><td><dl>The new resultant array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l604">code &raquo;</a><span class="member"><a name="goog.array.contains">goog.array.contains</a> <span class="args">( arr, obj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the array contains the given object.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>The array to test for the presence of the element.<dt>obj: <code class="type">*</code><dd>The object for which to test.</dl><tr><th>Returns<tr><td><dl>true if obj is present.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l495">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.count">goog.array.count</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Counts the array elements that fulfill the predicate, i.e. for which the callback function returns true. Skips holes in the array.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">!(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. Takes 3 arguments (the element, the index and the array).<dt>opt_obj: <code class="type">S=</code><dd>The object to be used as the value of 'this' within f.</dl><tr><th>Returns<tr><td><dl>The number of the matching elements.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1288">code &raquo;</a><code class="type">&lt;VALUE&gt;</code> <span class="member"><a name="goog.array.defaultCompare">goog.array.defaultCompare</a> <span class="args">( a, b )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Compares its two arguments for order, using the built in < and > operators.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>a: <code class="type">VALUE</code><dd>The first object to be compared.<dt>b: <code class="type">VALUE</code><dd>The second object to be compared.</dl><tr><th>Returns<tr><td><dl>A negative number, zero, or a positive number as the first argument is less than, equal to, or greater than the second.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1299">code &raquo;</a><span class="member"><a name="goog.array.defaultCompareEquality">goog.array.defaultCompareEquality</a> <span class="args">( a, b )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Compares its two arguments for equality, using the built in === operator.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>a: <code class="type">*</code><dd>The first object to compare.<dt>b: <code class="type">*</code><dd>The second object to compare.</dl><tr><th>Returns<tr><td><dl>True if the two arguments are equal, false otherwise.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1234">code &raquo;</a><span class="member"><a name="goog.array.equals">goog.array.equals</a> <span class="args">( arr1, arr2, opt_equalsFn )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Compares two arrays for equality. Two arrays are considered equal if they have the same length and their corresponding elements are equal according to the comparison function.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr1: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>The first array to compare.<dt>arr2: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>The second array to compare.<dt>opt_equalsFn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>=</code><dd>Optional comparison function. Should take 2 arguments to compare, and return true if the arguments are equal. Defaults to <code class="type"><a href="namespace_goog_array.html#goog.array.defaultCompareEquality">goog.array.defaultCompareEquality</a></code> which compares the elements using the built-in '===' operator.</dl><tr><th>Returns<tr><td><dl>Whether the two arrays are equal.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l463">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.every">goog.array.every</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Call f for each element of an array. If all calls return true, every() returns true. If any call returns false, every() returns false and does not continue to check the remaining elements. See <code class="type"><a class="unresolved-link">http://tinyurl.com/developer-mozilla-org-array-every</a></code></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for for every element. This function takes 3 arguments (the element, the index and the array) and should return a boolean.<dt>opt_obj: <code class="type">S=</code><dd>The object to be used as the value of 'this' within f.</dl><tr><th>Returns<tr><td><dl>false if any element fails the test.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l870">code &raquo;</a><code class="type">&lt;VALUE&gt;</code> <span class="member"><a name="goog.array.extend">goog.array.extend</a> <span class="args">( arr1, var_args )</span></span></div><p>Extends an array with another array, element, or "array like" object. This function operates 'in-place', it does not create a new Array. Example: var a = []; goog.array.extend(a, [0, 1]); a; // [0, 1] goog.array.extend(a, 2); a; // [0, 1, 2]</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr1: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;</code><dd>The array to modify.<dt>var_args: <code class="type">...(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;VALUE&gt;|VALUE)</code><dd>The elements or arrays of elements to add to arr1.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l259">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.filter">goog.array.filter</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;</code></span></div><p>Calls a function for each element in an array, and if the function returns true adds the element to a new array. See <code class="type"><a class="unresolved-link">http://tinyurl.com/developer-mozilla-org-array-filter</a></code></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. This function takes 3 arguments (the element, the index and the array) and must return a Boolean. If the return value is true the element is added to the result array. If it is false the element is not included.<dt>opt_obj: <code class="type">S=</code><dd>The object to be used as the value of 'this' within f.</dl><tr><th>Returns<tr><td><dl>a new array in which only elements that passed the test are present.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l519">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.find">goog.array.find</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type">?T</code></span></div><p>Search an array for the first element that satisfies a given condition and return that element.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. This function takes 3 arguments (the element, the index and the array) and should return a boolean.<dt>opt_obj: <code class="type">S=</code><dd>An optional "this" context for the function.</dl><tr><th>Returns<tr><td><dl>The first array element that passes the test, or null if no element is found.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l539">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.findIndex">goog.array.findIndex</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Search an array for the first element that satisfies a given condition and return its index.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. This function takes 3 arguments (the element, the index and the array) and should return a boolean.<dt>opt_obj: <code class="type">S=</code><dd>An optional "this" context for the function.</dl><tr><th>Returns<tr><td><dl>The index of the first array element that passes the test, or -1 if no element is found.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l585">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.findIndexRight">goog.array.findIndexRight</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Search an array (in reverse order) for the last element that satisfies a given condition and return its index.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. This function takes 3 arguments (the element, the index and the array) and should return a boolean.<dt>opt_obj: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>=</code><dd>An optional "this" context for the function.</dl><tr><th>Returns<tr><td><dl>The index of the last array element that passes the test, or -1 if no element is found.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l565">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.findRight">goog.array.findRight</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type">?T</code></span></div><p>Search an array (in reverse order) for the last element that satisfies a given condition and return that element.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. This function takes 3 arguments (the element, the index and the array) and should return a boolean.<dt>opt_obj: <code class="type">S=</code><dd>An optional "this" context for the function.</dl><tr><th>Returns<tr><td><dl>The last array element that passes the test, or null if no element is found.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1473">code &raquo;</a><span class="member"><a name="goog.array.flatten">goog.array.flatten</a> <span class="args">( var_args )</span> &rArr; <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Returns an array consisting of every argument with all arrays expanded in-place recursively.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...*</code><dd>The values to flatten.</dl><tr><th>Returns<tr><td><dl>An array containing the flattened values.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l196">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.forEach">goog.array.forEach</a> <span class="args">( arr, f, opt_obj )</span></span></div><p>Calls a function for each element in an array. Skips holes in the array. See <code class="type"><a class="unresolved-link">http://tinyurl.com/developer-mozilla-org-array-foreach</a></code></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): ?</code><dd>The function to call for every element. This function takes 3 arguments (the element, the index and the array). The return value is ignored.<dt>opt_obj: <code class="type">S=</code><dd>The object to be used as the value of 'this' within f.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l229">code &raquo;</a><code class="type">&lt;T, S&gt;</code> <span class="member"><a name="goog.array.forEachRight">goog.array.forEachRight</a> <span class="args">( arr, f, opt_obj )</span></span></div><p>Calls a function for each element in an array, starting from the last element rather than the first.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>Array or array like object over which to iterate.<dt>f: <code class="type">?function(this: S, T, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, ?): ?</code><dd>The function to call for every element. This function takes 3 arguments (the element, the index and the array). The return value is ignored.<dt>opt_obj: <code class="type">S=</code><dd>The object to be used as the value of 'this' within f.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l108">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.indexOf">goog.array.indexOf</a> <span class="args">( arr, obj, opt_fromIndex )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Returns the index of the first element of an array with a specified value, or -1 if the element is not present in the array. See <code class="type"><a class="unresolved-link">http://tinyurl.com/developer-mozilla-org-array-indexof</a></code></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to be searched.<dt>obj: <code class="type">T</code><dd>The object for which we are searching.<dt>opt_fromIndex: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The index at which to start the search. If omitted the search starts at index 0.</dl><tr><th>Returns<tr><td><dl>The index of the first matching array element.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l641">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.insert">goog.array.insert</a> <span class="args">( arr, obj )</span></span></div><p>Pushes an item into an array, if it's not already in the array.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;</code><dd>Array into which to insert the item.<dt>obj: <code class="type">T</code><dd>Value to add.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l667">code &raquo;</a><span class="member"><a name="goog.array.insertArrayAt">goog.array.insertArrayAt</a> <span class="args">( arr, elementsToAdd, opt_i )</span></span></div><p>Inserts at the given index of the array, all elements of another array.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>The array to modify.<dt>elementsToAdd: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>The array of elements to add.<dt>opt_i: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The index at which to insert the object. If omitted, treated as 0. A negative index is counted from the end of the array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l655">code &raquo;</a><span class="member"><a name="goog.array.insertAt">goog.array.insertAt</a> <span class="args">( arr, obj, opt_i )</span></span></div><p>Inserts an object at the given index of the array.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>The array to modify.<dt>obj: <code class="type">*</code><dd>The object to insert.<dt>opt_i: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The index at which to insert the object. If omitted, treated as 0. A negative index is counted from the end of the array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l680">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.insertBefore">goog.array.insertBefore</a> <span class="args">( arr, obj, opt_obj2 )</span></span></div><p>Inserts an object into an array before a specified object.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;</code><dd>The array to modify.<dt>obj: <code class="type">T</code><dd>The object to insert.<dt>opt_obj2: <code class="type">T=</code><dd>The object before which obj should be inserted. If obj2 is omitted or not found, obj is inserted at the end of the array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l614">code &raquo;</a><span class="member"><a name="goog.array.isEmpty">goog.array.isEmpty</a> <span class="args">( arr )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the array is empty.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a></code><dd>The array to test.</dl><tr><th>Returns<tr><td><dl>true if empty.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l1209">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.isSorted">goog.array.isSorted</a> <span class="args">( arr, opt_compareFn, opt_strict )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Tells if the array is sorted.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;</code><dd>The array.<dt>opt_compareFn: <code class="type">?function(T, T): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Function to compare the array elements. Should take 2 arguments to compare, and return a negative number, zero, or a positive number depending on whether the first argument is less than, equal to, or greater than the second.<dt>opt_strict: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>If true no equal elements are allowed.</dl><tr><th>Returns<tr><td><dl>Whether the array is sorted.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l811">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.join">goog.array.join</a> <span class="args">( var_args )</span> &rArr; <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;</code></span></div><p>Returns a new array that contains the contents of all the arrays passed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l78">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.last">goog.array.last</a> <span class="args">( array )</span> &rArr; <code class="type">T</code></span></div><p>Returns the last element in an array without removing it. Same as goog.array.peek.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>array: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array.</dl><tr><th>Returns<tr><td><dl>Last item in array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l150">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="goog.array.lastIndexOf">goog.array.lastIndexOf</a> <span class="args">( arr, obj, opt_fromIndex )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Returns the index of the last element of an array with a specified value, or -1 if the element is not present in the array. See <code class="type"><a class="unresolved-link">http://tinyurl.com/developer-mozilla-org-array-lastindexof</a></code></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;T&gt;|!<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to be searched.<dt>obj: <code class="type">T</code><dd>The object for which we are searching.<dt>opt_fromIndex: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The index at which to start the search. If omitted the search starts at the end of the array.</dl><tr><th>Returns<tr><td><dl>The index of the last matching array element.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/array/array.js.src.html#l300">code &raquo;</a><code class="type">&lt;THIS, VALUE, RESULT&gt;</code> <span class="member"><a name="goog.array.map">goog.array.map</a> <span class="args">( arr, f, opt_obj )</span> &rArr; <code class="type">!<a href="http://developer.mozilla.org/en/Core_Java