diff --git a/lib/extramath.js b/lib/extramath.js index 2a7254f..594f85d 100644 --- a/lib/extramath.js +++ b/lib/extramath.js @@ -73,7 +73,7 @@ function cartesianProduct(arr) { function clusteredCellsDensity(numbers, size, minDensity) { if (!numbers || !numbers.length) return false; if (typeof size !== 'number' || size <= 0) size = 4; // default grid size = 4 - if (typeof minDensity === 'undefined') minDensity = 0.6; + if (typeof minDensity !== 'number' || isNaN(minDensity)) minDensity = 0.6; var maxIndex = size * size; // because it's 1-based (1..size*size)