diff --git a/lib/console.js b/lib/console.js index 46b7f7627eddae..5654c11c90e136 100644 --- a/lib/console.js +++ b/lib/console.js @@ -325,8 +325,7 @@ Console.prototype.table = function(tabularData, properties) { if (properties !== undefined && !ArrayIsArray(properties)) throw new ERR_INVALID_ARG_TYPE('properties', 'Array', properties); - if (tabularData == null || - (typeof tabularData !== 'object' && typeof tabularData !== 'function')) + if (tabularData == null || typeof tabularData !== 'object') return this.log(tabularData); const final = (k, v) => this.log(cliTable(k, v)); diff --git a/test/parallel/test-console-table.js b/test/parallel/test-console-table.js index 64e2533f175e1d..2b63556acaa478 100644 --- a/test/parallel/test-console-table.js +++ b/test/parallel/test-console-table.js @@ -29,6 +29,7 @@ test(undefined, 'undefined\n'); test(false, 'false\n'); test('hi', 'hi\n'); test(Symbol(), 'Symbol()\n'); +test(function() {}, '[Function]\n'); test([1, 2, 3], ` ┌─────────┬────────┐