Other than using something else, no, you can't reasonably limit what console.log shows, and what it shows varies from console implementation to console implementation (or even within the same implementation depending on whether you're showing the console or not when log is called).
You may find console.dir more useful in this case than console.log. From MDN:
Displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
Of course, that's only really useful if you have an interactive console display (such as in a browser).
Alternately, you could use console.log(String(obj)); and override the default toString to do what you want:
Obj.prototype.toString = function() {
// generate your designer output here
return desiredOutputString;
};
Depending on the console implementation, in some cases, you may not need the String(...) part when calling console.log, but in most of them you would.
splitdata ? Or properties of theObj?console.log(obj.lines)orconsole.log(obj.some_property)consoleare you using?nodejsenvironment, but I plan to make it works onbrowsertoo. What I'm looking for is maybe some sort of__repr__method in python, which is nottoString, becausetoStringis__str__equivalents.