mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Remove double declared length var in sample.
This commit is contained in:
@@ -6375,7 +6375,7 @@
|
|||||||
function sample(collection, n, guard) {
|
function sample(collection, n, guard) {
|
||||||
if (guard || n == null) {
|
if (guard || n == null) {
|
||||||
collection = isArrayLike(collection) ? collection : values(collection);
|
collection = isArrayLike(collection) ? collection : values(collection);
|
||||||
var length = collection.length;
|
length = collection.length;
|
||||||
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
|
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
|
||||||
}
|
}
|
||||||
var index = -1,
|
var index = -1,
|
||||||
|
|||||||
Reference in New Issue
Block a user