I use the console
object in javascript for debugging, and would like to overwrite it as to make use of such functionality in mobile browsers.
However , I have trouble understanding the following MDN documentation
The Window.console read-only property returns a reference to the Console object, which provides methods for logging information to the browser's console.
(https://developer.mozilla.org/en-US/docs/Web/API/Window/console)
In particular:
- I cannot make head's or tails' of what actually is the
Window
interface, but it seems to be different to the globalwindow
property - A test showed (in current Chromium and Firefox) that window.console can indeed be overwritten event though it seems to contradict what I read in the documentation. (An example of such an overwriting provides this answer; even though a comment objects with
You can't use window.console = { ... } because window.console is a read-only property ! – Luillyfe Feb 23 at 21:28
What is it with the read-only-ness of Window.console
or window.console
?