diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 12f7cb9e53ce6b..444a07d23f7771 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -437,7 +437,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) {