diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index c3cad0e2f49d18..6ec27b9d1d9c05 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -475,7 +475,7 @@ function noPrototypeIterator(ctx, value, recurseTimes) { } else if (Array.isArray(value)) { const clazz = Object.getPrototypeOf(value) || clazzWithNullPrototype(Array, 'Array'); - newVal = new clazz(value.length || 0); + newVal = new clazz(value.length); } else if (isTypedArray(value)) { let clazz = Object.getPrototypeOf(value); if (!clazz) {