Replies: 1 comment 1 reply
-
I think the answer is no. This stack overflow question seem to be asking the thing: https://stackoverflow.com/questions/28397861/adjust-console-log-behaviour-of-custom-object. Looks like there is something specific to node, but nothing general. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to control the output of
console.log
on an instance of a bound class? I have many bound classes, and when Iconsole.log(myClassInstance)
I get something likeMyClass {}
. It would be interesting to override this and provide a custom object with more information about the instance.I know I could make a property, say,
MyClass.info,
but I'd prefer to be able to drop the class instance into console.log. Any way to do this that I am overlooking?Beta Was this translation helpful? Give feedback.
All reactions