- Version: v10.1.0
- Platform: macOS X
- Subsystem: console
This is a question. (And I admit it's a kind of nitpicking).
Current Behavior
According to the console.table document, it reads that it "falls back to just logging the argument if it can’t be parsed as tabular."
But it doesn't fall back when I give a function as its first argument. It logs an empty table.
$ node
> const f = function() {}
> console.table(f)
┌─────────┐
│ (index) │
├─────────┤
└─────────┘
$ node
> class Test {}
> console.table(Test)
┌─────────┐
│ (index) │
├─────────┤
└─────────┘
I guess that's because the following line allows a function to proceed the consequent steps.
|
(typeof tabularData !== 'object' && typeof tabularData !== 'function')) |
Question
Is this intentional behavior?
If it's better to change this behavior, I would be glad to send a patch for that.
This is a question. (And I admit it's a kind of nitpicking).
Current Behavior
According to the console.table document, it reads that it "falls back to just logging the argument if it can’t be parsed as tabular."
But it doesn't fall back when I give a function as its first argument. It logs an empty table.
I guess that's because the following line allows a function to proceed the consequent steps.
node/lib/console.js
Line 329 in 5096e24
Question
Is this intentional behavior?
If it's better to change this behavior, I would be glad to send a patch for that.