mirror of
https://github.com/samsonjs/batteries.git
synced 2026-03-25 09:15:46 +00:00
fix array extensions
This commit is contained in:
parent
3ecc25e518
commit
7f0cb97c10
1 changed files with 3 additions and 3 deletions
|
|
@ -5,8 +5,8 @@ exports.extendNative = function() {
|
|||
var fn = ArrayExt[k]
|
||||
, args = [].slice.call(arguments)
|
||||
;
|
||||
args.shift(this);
|
||||
fn.apply(ArrayExt, args);
|
||||
args.unshift(this);
|
||||
return fn.apply(ArrayExt, args);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
|
@ -46,7 +46,7 @@ var ArrayExt = exports.ArrayExt = {
|
|||
}
|
||||
|
||||
, grep: function(a, regex) {
|
||||
return a.filter(function(v) { return regex.match(v); });
|
||||
return a.filter(function(v) { return regex.test(v); });
|
||||
}
|
||||
|
||||
, last: function(a) { return a[a.length-1]; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue