mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Ensure _.initial and _.last work with NaN values for n.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user