mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Avoid unnecessarily coercing start to a number.
This commit is contained in:
@@ -3003,7 +3003,7 @@
|
|||||||
var index = -1,
|
var index = -1,
|
||||||
length = array ? array.length : 0;
|
length = array ? array.length : 0;
|
||||||
|
|
||||||
start = +start || 0;
|
start = typeof start == 'undefined' ? 0 : (+start || 0);
|
||||||
if (start < 0) {
|
if (start < 0) {
|
||||||
start = nativeMax(length + start, 0);
|
start = nativeMax(length + start, 0);
|
||||||
} else if (start > length) {
|
} else if (start > length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user