Because
document.__proto__.__proto__===Document.prototype
returns true, and since
Document.prototype.hasOwnProperty('body')
also returns true
can someone explain to me why document.body and Document.prototype.body are not the same thing? Moreover, why Document.prototype.body inside the Chrome developer tools leads to
Uncaught TypeError: Illegal invocation(โฆ)
(anonymous function) @ VM6098:2
InjectedScript._evaluateOn @ VM3911:904
InjectedScript._evaluateAndWrap @ VM3911:837
InjectedScript.evaluate @ VM3911:693
whereas document.body results
<body...>...</body>
source
share