In web browsers, window refers to an object that contains the global variables. This blog post explains how it works and when to use it.
* The global object and window
* Use cases for window
* The future of global variables
* Conclusion
We have seen several use cases for window. But you can normally achieve the same result by treating a global variable as a variable and not as a property of window. This is the recommended way of doing it, because your code becomes slightly more flexible and because the global scope will become less used in the future.
Your new post is loading...