diff --git a/Frameworks/JsClr/Internal/CoreEx.js b/Frameworks/JsClr/Internal/CoreEx.js index 6bb43b1..efcc964 100644 --- a/Frameworks/JsClr/Internal/CoreEx.js +++ b/Frameworks/JsClr/Internal/CoreEx.js @@ -217,21 +217,21 @@ JsTypes.push({ fullname: "Array", baseTypeName: "Object", definition: target.push(this[i]); } }, - //filter: function (pred) { - // var item, i = 0; - // for (var i = 0, j = this.length; i < j; i++) { - // item = this[i]; - // if (!pred(item)) { - // this.splice(i, 1); - // i--; //prevent increase - // j--; //length is decreased - // } - // } - // return this; - //}, - //filterOut: function (pred) { - // return this.filter(function (item) { return !pred(item); }); - //}, + filter: function (pred, thisArg) { + var item, i = 0; + for (var i = 0, j = this.length; i < j; i++) { + item = this[i]; + if (!pred.call(thisArg, item)) { + this.splice(i, 1); + i--; //prevent increase + j--; //length is decreased + } + } + return this; + }, + filterOut: function (pred) { + return this.filter(function (item) { return !pred(item); }); + }, apply: function (modifier) { for (var i = 0, j = this.length; i < j; i++) { this[i] = modifier(this[i]);