I am studying a Javascript book, " Javascript: The Definitive Guide - David Flanagan . Chapter 3 of this book talks about a global object, it says that
The global Window object has a self-referential window property, which can instead of this to refer to the global object.
What I understand from the above line is that the window is not an object, but a self-reference, but can someone explain to me in detail how this happens ... and how to create a self-referential property for a custom object.
Like in the chrome console, if I type a window , I get
Window {top: Window, location: Location, document: document, window: Window, external: Object ...}
How to achieve the same for custom objects. Sorry if I understood this completely wrong, sorry for that, I'm new to JS.
source share