Skip to content

Commit

Permalink
Merge branch 'oleneveu-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
danelkhen committed Jul 1, 2015
2 parents 43982e7 + ca54da7 commit 03f2fc6
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Frameworks/JsClr/Internal/CoreEx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 03f2fc6

Please sign in to comment.