How do I change the string representation of an object instance in nodejs debug console. Is there a method (like toString()
in .NET) I can override?
There is a toString() method that you call on another string.
terms[200]._text.toString()
You may also be looking for JSON.stringify()
which I find extremely useful in debugging. Since JavaScript objects are literally JSON, this will make printing them out to the console simpler.
console.log(JSON.stringify(terms[200]))