Ensure _.initial and _.last work with NaN values for n.

This commit is contained in:
John-David Dalton
2014-04-02 00:23:31 -07:00
parent 3225f17f5a
commit 7f9a2a2d34
2 changed files with 19 additions and 19 deletions

View File

@@ -2746,7 +2746,7 @@
} else {
n = (predicate == null || thisArg) ? 1 : predicate;
}
n = length - n;
n = length - (n || 0);
return slice(array, 0, n < 0 ? 0 : n);
}
@@ -2840,8 +2840,8 @@
return array ? array[length - 1] : undefined;
}
}
n = length - n;
return slice(array, n < 0 ? 0 : n);
n = length - (n || 0);
return slice(array, n < 0 ? 0 : n);
}
/**