Is there a method I can override on a JavaScript object to control what is displayed by console.log?

后端 未结 4 1034
旧时难觅i
旧时难觅i 2020-12-07 01:29

I\'m thinking in particular of Chrome, though Firebug would be interesting to. I\'ve tried toString() and valueOf(), but neither of those seem to be used. Interestingly, i

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 01:32

    Just for future readers, there is now a way to do exactly what is asked here.

    For the solution please read this duplicated post:

    adjust console.log behaviour of custom object

提交回复
热议问题