Ever gotten some output on the console like [Object object]
, with no explanation?
Can't find where it's being logged?
Maybe it comes right before some ludicrous error or crash.
Sometimes you just need a hack.
JavaScript
var ots = Object.prototype.toString;
Object.prototype.toString = function() { try { return JSON.stringify(this); } catch (e) { return ots.apply(this); } };