Now this has no practical implications at all, but I am curious about this little quirk I stumbled upon.
Basically, in Chrome’s developer console, this
toString()
returns [object Object], whereas this
this.toString()
returns [object DOMWindow].
As far as I know, this only happens from the console, as can be seen on this jsFiddle. Someone on ##javascript found this link explaining where the function comes from. However, it doesn’t explain the discrepancy there is in the behavior when used within or outside the console.
So why do toString() and this.toString() produce different results in Chrome’s console?
WebKit happened to use wrong context for global calls in the console.
(Chrome 14):
I think this has been fixed over here