Check for undefined values when making filled arrays
This commit is contained in:
parent
2d36bb0739
commit
bbb579b2b9
1 changed files with 4 additions and 1 deletions
|
@ -8,7 +8,10 @@ make.arrays = {
|
|||
let size = limit || random.number(make.number.tiny()) + 1
|
||||
|
||||
for (let i = 0; i < size; i++) {
|
||||
array.push(random.pick(fn))
|
||||
let value = random.pick(fn)
|
||||
if (value !== undefined) {
|
||||
array.push(value)
|
||||
}
|
||||
}
|
||||
|
||||
return array
|
||||
|
|
Loading…
Reference in a new issue