4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-Array'>/**
19 </span> * @author Jacky Nguyen <jacky@sencha.com>
20 * @docauthor Jacky Nguyen <jacky@sencha.com>
23 * A set of useful static methods to deal with arrays; provide missing methods for older browsers.
30 var arrayPrototype = Array.prototype,
31 slice = arrayPrototype.slice,
32 supportsSplice = function () {
41 // This detects a bug in IE8 splice method:
42 // see http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/6e946d03-e09f-4b22-a4dd-cd5e276bf05a/
45 array.push("A");
48 array.splice(15, 0, "F", "F", "F", "F", "F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F");
50 lengthBefore = array.length; //41
51 array.splice(13, 0, "XXX"); // add one element
53 if (lengthBefore+1 != array.length) {
60 supportsForEach = 'forEach' in arrayPrototype,
61 supportsMap = 'map' in arrayPrototype,
62 supportsIndexOf = 'indexOf' in arrayPrototype,
63 supportsEvery = 'every' in arrayPrototype,
64 supportsSome = 'some' in arrayPrototype,
65 supportsFilter = 'filter' in arrayPrototype,
66 supportsSort = function() {
67 var a = [1,2,3,4,5].sort(function(){ return 0; });
68 return a[0] === 1 && a[1] === 2 && a[2] === 3 && a[3] === 4 && a[4] === 5;
70 supportsSliceOnNodeList = true,
74 // IE 6 - 8 will throw an error when using Array.prototype.slice on NodeList
75 if (typeof document !== 'undefined') {
76 slice.call(document.getElementsByTagName('body'));
79 supportsSliceOnNodeList = false;
82 function fixArrayIndex (array, index) {
83 return (index < 0) ? Math.max(0, array.length + index)
84 : Math.min(array.length, index);
88 Does the same work as splice, but with a slightly more convenient signature. The splice
89 method has bugs in IE8, so this is the implementation we use on that platform.
91 The rippling of items in the array can be tricky. Consider two use cases:
96 +---+---+---+---+---+---+---+---+
97 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
98 +---+---+---+---+---+---+---+---+
101 / / \/ \/ \ +--------------------------+
102 / / /\ /\ +--------------------------+ \
103 / / / \/ +--------------------------+ \ \
104 / / / /+--------------------------+ \ \ \
107 +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
108 | 0 | 1 | 4 | 5 | 6 | 7 | | 0 | 1 | a | b | c | 4 | 5 | 6 | 7 |
109 +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
113 In case A, it is obvious that copying of [4,5,6,7] must be left-to-right so
114 that we don't end up with [0,1,6,7,6,7]. In case B, we have the opposite; we
115 must go right-to-left or else we would end up with [0,1,a,b,c,4,4,4,4].
117 function replaceSim (array, index, removeCount, insert) {
118 var add = insert ? insert.length : 0,
119 length = array.length,
120 pos = fixArrayIndex(array, index);
122 // we try to use Array.push when we can for efficiency...
123 if (pos === length) {
125 array.push.apply(array, insert);
128 var remove = Math.min(removeCount, length - pos),
129 tailOldPos = pos + remove,
130 tailNewPos = tailOldPos + add - remove,
131 tailCount = length - tailOldPos,
132 lengthAfterRemove = length - remove,
135 if (tailNewPos < tailOldPos) { // case A
136 for (i = 0; i < tailCount; ++i) {
137 array[tailNewPos+i] = array[tailOldPos+i];
139 } else if (tailNewPos > tailOldPos) { // case B
140 for (i = tailCount; i--; ) {
141 array[tailNewPos+i] = array[tailOldPos+i];
143 } // else, add == remove (nothing to do)
145 if (add && pos === lengthAfterRemove) {
146 array.length = lengthAfterRemove; // truncate array
147 array.push.apply(array, insert);
149 array.length = lengthAfterRemove + add; // reserves space
150 for (i = 0; i < add; ++i) {
151 array[pos+i] = insert[i];
159 function replaceNative (array, index, removeCount, insert) {
160 if (insert && insert.length) {
161 if (index < array.length) {
162 array.splice.apply(array, [index, removeCount].concat(insert));
164 array.push.apply(array, insert);
167 array.splice(index, removeCount);
172 function eraseSim (array, index, removeCount) {
173 return replaceSim(array, index, removeCount);
176 function eraseNative (array, index, removeCount) {
177 array.splice(index, removeCount);
181 function spliceSim (array, index, removeCount) {
182 var pos = fixArrayIndex(array, index),
183 removed = array.slice(index, fixArrayIndex(array, pos+removeCount));
185 if (arguments.length < 4) {
186 replaceSim(array, pos, removeCount);
188 replaceSim(array, pos, removeCount, slice.call(arguments, 3));
194 function spliceNative (array) {
195 return array.splice.apply(array, slice.call(arguments, 1));
198 var erase = supportsSplice ? eraseNative : eraseSim,
199 replace = supportsSplice ? replaceNative : replaceSim,
200 splice = supportsSplice ? spliceNative : spliceSim;
202 // NOTE: from here on, use erase, replace or splice (not native methods)...
204 ExtArray = Ext.Array = {
205 <span id='Ext-Array-method-each'> /**
206 </span> * Iterates an array or an iterable value and invoke the given callback function for each item.
208 * var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
210 * Ext.Array.each(countries, function(name, index, countriesItSelf) {
214 * var sum = function() {
217 * Ext.Array.each(arguments, function(value) {
224 * sum(1, 2, 3); // returns 6
226 * The iteration can be stopped by returning false in the function callback.
228 * Ext.Array.each(countries, function(name, index, countriesItSelf) {
229 * if (name === 'Singapore') {
230 * return false; // break here
234 * {@link Ext#each Ext.each} is alias for {@link Ext.Array#each Ext.Array.each}
236 * @param {Array/NodeList/Mixed} iterable The value to be iterated. If this
237 * argument is not iterable, the callback function is called once.
238 * @param {Function} fn The callback function. If it returns false, the iteration stops and this method returns
239 * the current `index`. Arguments passed to this callback function are:
241 * - `item` : Mixed - The item at the current `index` in the passed `array`
242 * - `index` : Number - The current `index` within the `array`
243 * - `allItems` : Array/NodeList/Mixed - The `array` passed as the first argument to `Ext.Array.each`
245 * @param {Object} scope (Optional) The scope (`this` reference) in which the specified function is executed.
246 * @param {Boolean} reverse (Optional) Reverse the iteration order (loop from the end to the beginning)
248 * @return {Boolean} See description for the `fn` parameter.
250 each: function(array, fn, scope, reverse) {
251 array = ExtArray.from(array);
256 if (reverse !== true) {
257 for (i = 0; i < ln; i++) {
258 if (fn.call(scope || array[i], array[i], i, array) === false) {
264 for (i = ln - 1; i > -1; i--) {
265 if (fn.call(scope || array[i], array[i], i, array) === false) {
274 <span id='Ext-Array-method-forEach'> /**
275 </span> * Iterates an array and invoke the given callback function for each item. Note that this will simply
276 * delegate to the native Array.prototype.forEach method if supported.
277 * It doesn't support stopping the iteration by returning false in the callback function like
278 * {@link Ext.Array#each}. However, performance could be much better in modern browsers comparing with
279 * {@link Ext.Array#each}
281 * @param {Array} array The array to iterate
282 * @param {Function} fn The function callback, to be invoked these arguments:
284 * - `item` : Mixed - The item at the current `index` in the passed `array`
285 * - `index` : Number - The current `index` within the `array`
286 * - `allItems` : Array - The `array` itself which was passed as the first argument
288 * @param {Object} scope (Optional) The execution scope (`this`) in which the specified function is executed.
290 forEach: function(array, fn, scope) {
291 if (supportsForEach) {
292 return array.forEach(fn, scope);
298 for (; i < ln; i++) {
299 fn.call(scope, array[i], i, array);
303 <span id='Ext-Array-method-indexOf'> /**
304 </span> * Get the index of the provided `item` in the given `array`, a supplement for the
305 * missing arrayPrototype.indexOf in Internet Explorer.
307 * @param {Array} array The array to check
308 * @param {Mixed} item The item to look for
309 * @param {Number} from (Optional) The index at which to begin the search
310 * @return {Number} The index of item in the array (or -1 if it is not found)
312 indexOf: function(array, item, from) {
313 if (supportsIndexOf) {
314 return array.indexOf(item, from);
317 var i, length = array.length;
319 for (i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++) {
320 if (array[i] === item) {
328 <span id='Ext-Array-method-contains'> /**
329 </span> * Checks whether or not the given `array` contains the specified `item`
331 * @param {Array} array The array to check
332 * @param {Mixed} item The item to look for
333 * @return {Boolean} True if the array contains the item, false otherwise
335 contains: function(array, item) {
336 if (supportsIndexOf) {
337 return array.indexOf(item) !== -1;
342 for (i = 0, ln = array.length; i < ln; i++) {
343 if (array[i] === item) {
351 <span id='Ext-Array-method-toArray'> /**
352 </span> * Converts any iterable (numeric indices and a length property) into a true array.
355 * var args = Ext.Array.toArray(arguments),
356 * fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
358 * alert(args.join(' '));
359 * alert(fromSecondToLastArgs.join(' '));
362 * test('just', 'testing', 'here'); // alerts 'just testing here';
363 * // alerts 'testing here';
365 * Ext.Array.toArray(document.getElementsByTagName('div')); // will convert the NodeList into an array
366 * Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
367 * Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l', 'i']
369 * {@link Ext#toArray Ext.toArray} is alias for {@link Ext.Array#toArray Ext.Array.toArray}
371 * @param {Mixed} iterable the iterable object to be turned into a true Array.
372 * @param {Number} start (Optional) a zero-based index that specifies the start of extraction. Defaults to 0
373 * @param {Number} end (Optional) a zero-based index that specifies the end of extraction. Defaults to the last
374 * index of the iterable value
375 * @return {Array} array
377 toArray: function(iterable, start, end){
378 if (!iterable || !iterable.length) {
382 if (typeof iterable === 'string') {
383 iterable = iterable.split('');
386 if (supportsSliceOnNodeList) {
387 return slice.call(iterable, start || 0, end || iterable.length);
394 end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
396 for (i = start; i < end; i++) {
397 array.push(iterable[i]);
403 <span id='Ext-Array-method-pluck'> /**
404 </span> * Plucks the value of a property from each item in the Array. Example:
406 * Ext.Array.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
408 * @param {Array|NodeList} array The Array of items to pluck the value from.
409 * @param {String} propertyName The property name to pluck from each element.
410 * @return {Array} The value from each item in the Array.
412 pluck: function(array, propertyName) {
416 for (i = 0, ln = array.length; i < ln; i++) {
419 ret.push(item[propertyName]);
425 <span id='Ext-Array-method-map'> /**
426 </span> * Creates a new array with the results of calling a provided function on every element in this array.
428 * @param {Array} array
429 * @param {Function} fn Callback function for each item
430 * @param {Object} scope Callback function scope
431 * @return {Array} results
433 map: function(array, fn, scope) {
435 return array.map(fn, scope);
442 for (; i < len; i++) {
443 results[i] = fn.call(scope, array[i], i, array);
449 <span id='Ext-Array-method-every'> /**
450 </span> * Executes the specified function for each array element until the function returns a falsy value.
451 * If such an item is found, the function will return false immediately.
452 * Otherwise, it will return true.
454 * @param {Array} array
455 * @param {Function} fn Callback function for each item
456 * @param {Object} scope Callback function scope
457 * @return {Boolean} True if no false value is returned by the callback function.
459 every: function(array, fn, scope) {
462 Ext.Error.raise('Ext.Array.every must have a callback function passed as second argument.');
466 return array.every(fn, scope);
472 for (; i < ln; ++i) {
473 if (!fn.call(scope, array[i], i, array)) {
481 <span id='Ext-Array-method-some'> /**
482 </span> * Executes the specified function for each array element until the function returns a truthy value.
483 * If such an item is found, the function will return true immediately. Otherwise, it will return false.
485 * @param {Array} array
486 * @param {Function} fn Callback function for each item
487 * @param {Object} scope Callback function scope
488 * @return {Boolean} True if the callback function returns a truthy value.
490 some: function(array, fn, scope) {
493 Ext.Error.raise('Ext.Array.some must have a callback function passed as second argument.');
497 return array.some(fn, scope);
503 for (; i < ln; ++i) {
504 if (fn.call(scope, array[i], i, array)) {
512 <span id='Ext-Array-method-clean'> /**
513 </span> * Filter through an array and remove empty item as defined in {@link Ext#isEmpty Ext.isEmpty}
515 * See {@link Ext.Array#filter}
517 * @param {Array} array
518 * @return {Array} results
520 clean: function(array) {
526 for (; i < ln; i++) {
529 if (!Ext.isEmpty(item)) {
537 <span id='Ext-Array-method-unique'> /**
538 </span> * Returns a new array with unique items
540 * @param {Array} array
541 * @return {Array} results
543 unique: function(array) {
549 for (; i < ln; i++) {
552 if (ExtArray.indexOf(clone, item) === -1) {
560 <span id='Ext-Array-method-filter'> /**
561 </span> * Creates a new array with all of the elements of this array for which
562 * the provided filtering function returns true.
564 * @param {Array} array
565 * @param {Function} fn Callback function for each item
566 * @param {Object} scope Callback function scope
567 * @return {Array} results
569 filter: function(array, fn, scope) {
570 if (supportsFilter) {
571 return array.filter(fn, scope);
578 for (; i < ln; i++) {
579 if (fn.call(scope, array[i], i, array)) {
580 results.push(array[i]);
587 <span id='Ext-Array-method-from'> /**
588 </span> * Converts a value to an array if it's not already an array; returns:
590 * - An empty array if given value is `undefined` or `null`
591 * - Itself if given value is already an array
592 * - An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList and alike)
593 * - An array with one item which is the given value, otherwise
595 * @param {Array/Mixed} value The value to convert to an array if it's not already is an array
596 * @param {Boolean} (Optional) newReference True to clone the given array and return a new reference if necessary,
598 * @return {Array} array
600 from: function(value, newReference) {
601 if (value === undefined || value === null) {
605 if (Ext.isArray(value)) {
606 return (newReference) ? slice.call(value) : value;
609 if (value && value.length !== undefined && typeof value !== 'string') {
610 return Ext.toArray(value);
616 <span id='Ext-Array-method-remove'> /**
617 </span> * Removes the specified item from the array if it exists
619 * @param {Array} array The array
620 * @param {Mixed} item The item to remove
621 * @return {Array} The passed array itself
623 remove: function(array, item) {
624 var index = ExtArray.indexOf(array, item);
627 erase(array, index, 1);
633 <span id='Ext-Array-method-include'> /**
634 </span> * Push an item into the array only if the array doesn't contain it yet
636 * @param {Array} array The array
637 * @param {Mixed} item The item to include
639 include: function(array, item) {
640 if (!ExtArray.contains(array, item)) {
645 <span id='Ext-Array-method-clone'> /**
646 </span> * Clone a flat array without referencing the previous one. Note that this is different
647 * from Ext.clone since it doesn't handle recursive cloning. It's simply a convenient, easy-to-remember method
648 * for Array.prototype.slice.call(array)
650 * @param {Array} array The array
651 * @return {Array} The clone array
653 clone: function(array) {
654 return slice.call(array);
657 <span id='Ext-Array-method-merge'> /**
658 </span> * Merge multiple arrays into one with unique items.
660 * {@link Ext.Array#union} is alias for {@link Ext.Array#merge}
662 * @param {Array} array1
663 * @param {Array} array2
665 * @return {Array} merged
668 var args = slice.call(arguments),
672 for (i = 0, ln = args.length; i < ln; i++) {
673 array = array.concat(args[i]);
676 return ExtArray.unique(array);
679 <span id='Ext-Array-method-intersect'> /**
680 </span> * Merge multiple arrays into one with unique items that exist in all of the arrays.
682 * @param {Array} array1
683 * @param {Array} array2
685 * @return {Array} intersect
687 intersect: function() {
689 arrays = slice.call(arguments),
690 i, j, k, minArray, array, x, y, ln, arraysLn, arrayLn;
692 if (!arrays.length) {
696 // Find the smallest array
697 for (i = x = 0,ln = arrays.length; i < ln,array = arrays[i]; i++) {
698 if (!minArray || array.length < minArray.length) {
704 minArray = ExtArray.unique(minArray);
707 // Use the smallest unique'd array as the anchor loop. If the other array(s) do contain
708 // an item in the small array, we're likely to find it before reaching the end
709 // of the inner loop and can terminate the search early.
710 for (i = 0,ln = minArray.length; i < ln,x = minArray[i]; i++) {
713 for (j = 0,arraysLn = arrays.length; j < arraysLn,array = arrays[j]; j++) {
714 for (k = 0,arrayLn = array.length; k < arrayLn,y = array[k]; k++) {
722 if (count === arraysLn) {
730 <span id='Ext-Array-method-difference'> /**
731 </span> * Perform a set difference A-B by subtracting all items in array B from array A.
733 * @param {Array} arrayA
734 * @param {Array} arrayB
735 * @return {Array} difference
737 difference: function(arrayA, arrayB) {
738 var clone = slice.call(arrayA),
742 for (i = 0,lnB = arrayB.length; i < lnB; i++) {
743 for (j = 0; j < ln; j++) {
744 if (clone[j] === arrayB[i]) {
755 <span id='Ext-Array-method-slice'> /**
756 </span> * Returns a shallow copy of a part of an array. This is equivalent to the native
757 * call "Array.prototype.slice.call(array, begin, end)". This is often used when "array"
758 * is "arguments" since the arguments object does not supply a slice method but can
759 * be the context object to Array.prototype.slice.
761 * @param {Array} array The array (or arguments object).
762 * @param {Number} begin The index at which to begin. Negative values are offsets from
763 * the end of the array.
764 * @param {Number} end The index at which to end. The copied items do not include
765 * end. Negative values are offsets from the end of the array. If end is omitted,
766 * all items up to the end of the array are copied.
767 * @return {Array} The copied piece of the array.
769 slice: function(array, begin, end) {
770 return slice.call(array, begin, end);
773 <span id='Ext-Array-method-sort'> /**
774 </span> * Sorts the elements of an Array.
775 * By default, this method sorts the elements alphabetically and ascending.
777 * @param {Array} array The array to sort.
778 * @param {Function} sortFn (optional) The comparison function.
779 * @return {Array} The sorted array.
781 sort: function(array, sortFn) {
784 return array.sort(sortFn);
790 var length = array.length,
795 for (; i < length; i++) {
797 for (j = i + 1; j < length; j++) {
799 comparison = sortFn(array[j], array[min]);
800 if (comparison < 0) {
803 } else if (array[j] < array[min]) {
809 array[i] = array[min];
817 <span id='Ext-Array-method-flatten'> /**
818 </span> * Recursively flattens into 1-d Array. Injects Arrays inline.
821 flatten: function(array) {
824 function rFlatten(a) {
827 for (i = 0, ln = a.length; i < ln; i++) {
830 if (Ext.isArray(v)) {
840 return rFlatten(array);
843 <span id='Ext-Array-method-min'> /**
844 </span> * Returns the minimum value in the Array.
846 * @param {Array|NodeList} array The Array from which to select the minimum value.
847 * @param {Function} comparisonFn (optional) a function to perform the comparision which determines minimization.
848 * If omitted the "<" operator will be used. Note: gt = 1; eq = 0; lt = -1
849 * @return {Mixed} minValue The minimum value
851 min: function(array, comparisonFn) {
855 for (i = 0, ln = array.length; i < ln; i++) {
859 if (comparisonFn(min, item) === 1) {
873 <span id='Ext-Array-method-max'> /**
874 </span> * Returns the maximum value in the Array.
876 * @param {Array|NodeList} array The Array from which to select the maximum value.
877 * @param {Function} comparisonFn (optional) a function to perform the comparision which determines maximization.
878 * If omitted the ">" operator will be used. Note: gt = 1; eq = 0; lt = -1
879 * @return {Mixed} maxValue The maximum value
881 max: function(array, comparisonFn) {
885 for (i = 0, ln = array.length; i < ln; i++) {
889 if (comparisonFn(max, item) === -1) {
903 <span id='Ext-Array-method-mean'> /**
904 </span> * Calculates the mean of all items in the array.
906 * @param {Array} array The Array to calculate the mean value of.
907 * @return {Number} The mean.
909 mean: function(array) {
910 return array.length > 0 ? ExtArray.sum(array) / array.length : undefined;
913 <span id='Ext-Array-method-sum'> /**
914 </span> * Calculates the sum of all items in the given array.
916 * @param {Array} array The Array to calculate the sum value of.
917 * @return {Number} The sum.
919 sum: function(array) {
923 for (i = 0,ln = array.length; i < ln; i++) {
933 _replaceSim: replaceSim, // for unit testing
934 _spliceSim: spliceSim,
937 <span id='Ext-Array-method-erase'> /**
938 </span> * Removes items from an array. This is functionally equivalent to the splice method
939 * of Array, but works around bugs in IE8's splice method and does not copy the
940 * removed elements in order to return them (because very often they are ignored).
942 * @param {Array} array The Array on which to replace.
943 * @param {Number} index The index in the array at which to operate.
944 * @param {Number} removeCount The number of items to remove at index.
945 * @return {Array} The array passed.
950 <span id='Ext-Array-method-insert'> /**
951 </span> * Inserts items in to an array.
953 * @param {Array} array The Array on which to replace.
954 * @param {Number} index The index in the array at which to operate.
955 * @param {Array} items The array of items to insert at index.
956 * @return {Array} The array passed.
958 insert: function (array, index, items) {
959 return replace(array, index, 0, items);
962 <span id='Ext-Array-method-replace'> /**
963 </span> * Replaces items in an array. This is functionally equivalent to the splice method
964 * of Array, but works around bugs in IE8's splice method and is often more convenient
965 * to call because it accepts an array of items to insert rather than use a variadic
968 * @param {Array} array The Array on which to replace.
969 * @param {Number} index The index in the array at which to operate.
970 * @param {Number} removeCount The number of items to remove at index (can be 0).
971 * @param {Array} insert An optional array of items to insert at index.
972 * @return {Array} The array passed.
977 <span id='Ext-Array-method-splice'> /**
978 </span> * Replaces items in an array. This is equivalent to the splice method of Array, but
979 * works around bugs in IE8's splice method. The signature is exactly the same as the
980 * splice method except that the array is the first argument. All arguments following
981 * removeCount are inserted in the array at index.
983 * @param {Array} array The Array on which to replace.
984 * @param {Number} index The index in the array at which to operate.
985 * @param {Number} removeCount The number of items to remove at index (can be 0).
986 * @return {Array} An array containing the removed items.
992 <span id='Ext-method-each'> /**
995 * @alias Ext.Array#each
997 Ext.each = ExtArray.each;
999 <span id='Ext-Array-method-union'> /**
1002 * @alias Ext.Array#merge
1004 ExtArray.union = ExtArray.merge;
1006 <span id='Ext-method-min'> /**
1007 </span> * Old alias to {@link Ext.Array#min}
1008 * @deprecated 4.0.0 Use {@link Ext.Array#min} instead
1011 * @alias Ext.Array#min
1013 Ext.min = ExtArray.min;
1015 <span id='Ext-method-max'> /**
1016 </span> * Old alias to {@link Ext.Array#max}
1017 * @deprecated 4.0.0 Use {@link Ext.Array#max} instead
1020 * @alias Ext.Array#max
1022 Ext.max = ExtArray.max;
1024 <span id='Ext-method-sum'> /**
1025 </span> * Old alias to {@link Ext.Array#sum}
1026 * @deprecated 4.0.0 Use {@link Ext.Array#sum} instead
1029 * @alias Ext.Array#sum
1031 Ext.sum = ExtArray.sum;
1033 <span id='Ext-method-mean'> /**
1034 </span> * Old alias to {@link Ext.Array#mean}
1035 * @deprecated 4.0.0 Use {@link Ext.Array#mean} instead
1038 * @alias Ext.Array#mean
1040 Ext.mean = ExtArray.mean;
1042 <span id='Ext-method-flatten'> /**
1043 </span> * Old alias to {@link Ext.Array#flatten}
1044 * @deprecated 4.0.0 Use {@link Ext.Array#flatten} instead
1047 * @alias Ext.Array#flatten
1049 Ext.flatten = ExtArray.flatten;
1051 <span id='Ext-method-clean'> /**
1052 </span> * Old alias to {@link Ext.Array#clean}
1053 * @deprecated 4.0.0 Use {@link Ext.Array#clean} instead
1056 * @alias Ext.Array#clean
1058 Ext.clean = ExtArray.clean;
1060 <span id='Ext-method-unique'> /**
1061 </span> * Old alias to {@link Ext.Array#unique}
1062 * @deprecated 4.0.0 Use {@link Ext.Array#unique} instead
1065 * @alias Ext.Array#unique
1067 Ext.unique = ExtArray.unique;
1069 <span id='Ext-method-pluck'> /**
1070 </span> * Old alias to {@link Ext.Array#pluck Ext.Array.pluck}
1071 * @deprecated 4.0.0 Use {@link Ext.Array#pluck Ext.Array.pluck} instead
1074 * @alias Ext.Array#pluck
1076 Ext.pluck = ExtArray.pluck;
1078 <span id='Ext-method-toArray'> /**
1081 * @alias Ext.Array#toArray
1083 Ext.toArray = function() {
1084 return ExtArray.toArray.apply(ExtArray, arguments);