mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Remove arguments references where possible.
This commit is contained in:
@@ -24,14 +24,7 @@ function negate(predicate) {
|
||||
if (typeof predicate != 'function') {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
return function() {
|
||||
const args = arguments;
|
||||
switch (args.length) {
|
||||
case 0: return !predicate.call(this);
|
||||
case 1: return !predicate.call(this, args[0]);
|
||||
case 2: return !predicate.call(this, args[0], args[1]);
|
||||
case 3: return !predicate.call(this, args[0], args[1], args[2]);
|
||||
}
|
||||
return function(...args) {
|
||||
return !predicate.apply(this, args);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user