4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
14 Roo.applyIf(Array.prototype, {
17 * Checks whether or not the specified object exists in the array.
18 * @param {Object} o The object to check for
19 * @return {Number} The index of o in the array (or -1 if it is not found)
21 indexOf : function(o){
22 for (var i = 0, len = this.length; i < len; i++){
23 if(this[i] == o) { return i; }
29 * Removes the specified object from the array. If the object is not found nothing happens.
30 * @param {Object} o The object to remove
33 var index = this.indexOf(o);
35 this.splice(index, 1);
39 * Map (JS 1.6 compatibility)
40 * @param {Function} function to call
44 var len = this.length >>> 0;
45 if (typeof fun != "function") {
46 throw new TypeError();
48 var res = new Array(len);
49 var thisp = arguments[1];
50 for (var i = 0; i < len; i++)
53 res[i] = fun.call(thisp, this[i], i, this);
61 * @param {Array} o The array to compare to
62 * @returns {Boolean} true if the same
66 // https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
73 if (this.length !== b.length) {
77 // sort?? a.sort().equals(b.sort());
79 for (var i = 0; i < this.length; ++i) {
80 if (this[i] !== b[i]) {