Check for undefined values when making filled arrays

This commit is contained in:
pyoor 2017-07-21 14:05:40 -04:00
parent 2d36bb0739
commit bbb579b2b9

View file

@ -8,7 +8,10 @@ make.arrays = {
let size = limit || random.number(make.number.tiny()) + 1 let size = limit || random.number(make.number.tiny()) + 1
for (let i = 0; i < size; i++) { 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 return array