X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Array.js;h=4095aee53d76776f7435444f9c6c0dad8da84a94;hp=416f2f4e48198649f8c628c53088cdfe25cab13b;hb=3187d8d7fc0abe5aedd4da088d982837a6f83dc3;hpb=24af13261fef7d26a66e03cd1d55d1d103330d94 diff --git a/Array.js b/Array.js index 416f2f4e48..4095aee53d 100644 --- a/Array.js +++ b/Array.js @@ -13,13 +13,14 @@ */ Roo.applyIf(Array.prototype, { /** + * * Checks whether or not the specified object exists in the array. * @param {Object} o The object to check for * @return {Number} The index of o in the array (or -1 if it is not found) */ indexOf : function(o){ for (var i = 0, len = this.length; i < len; i++){ - if(this[i] == o) return i; + if(this[i] == o) { return i; } } return -1; }, @@ -41,15 +42,16 @@ Roo.applyIf(Array.prototype, { map : function(fun ) { var len = this.length >>> 0; - if (typeof fun != "function") + if (typeof fun != "function") { throw new TypeError(); - + } var res = new Array(len); var thisp = arguments[1]; for (var i = 0; i < len; i++) { - if (i in this) + if (i in this) { res[i] = fun.call(thisp, this[i], i, this); + } } return res; @@ -58,4 +60,4 @@ Roo.applyIf(Array.prototype, { }); - \ No newline at end of file +