- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript window Object
JavaScript Storage & BOM
JavaScript window Object
windowrepresents the browser tab and is the top of the global scope.
Every global variable and function is technically a property of it.
You rarely write window. yourself, but it is always there.
Example
Example
javascript
console.log(typeof window);
console.log(typeof window.document);Both are object.
What window Provides
window.innerWidth and innerHeight - the visible area.
window.location - the current URL.
window.document - the page itself.
