Skip to content

Commit

Permalink
Use Math.max to simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Apr 8, 2015
1 parent 33f6489 commit d9a6f91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
var restParam = function(func, startIndex) {
startIndex = startIndex == null ? func.length - 1 : +startIndex;
return function() {
var length = arguments.length > startIndex ? arguments.length - startIndex : 0;
var length = Math.max(arguments.length - startIndex, 0);
var rest = Array(length);
for (var index = 0; index < length; index++) {
rest[index] = arguments[index + startIndex];
Expand Down

0 comments on commit d9a6f91

Please sign in to comment.