✏️ 1.2.1.7 Practice: Accessing Window Properties
Goal: In the "Accessing Window Properties" lesson, we learned:
- The 
windowobject has properties with different values: primitives, objects, or methods. We can explore these in the DevTools console and we can use JavaScript to manipulate that data. - We use dot notation to access 
windowproperties, likewindow.innerHeightorwindow.open(). - When a 
windowproperty itself is an object with properties, we can chain dot notation to access the nested object's property. A good example of this iswindow.location.href, where we're accessing thewindowobject's property calledlocation, and then we're accessing thelocationobject's property calledhref. 
Begin familiarizing yourself with the window object by completing the following exercises in the DevTools console. 
Warm Up
- What does the 
windowobject represent? What sort of information can we get from it? - What is a property?
 - What is dot notation and how do we use it?
 - What are Web APIs? What is an API?
 
Code
Accessing window Properties
Access the window object to find the following information:
- Find the value of the 
innerHeightof the window. - Find the 
hrefof the webpage you are currently on. - Access the 
window.screenproperty in your console, and expand the object so that you can see the properties. Then, access theheightproperty of thescreenobject. Turn theheightproperty into a string. 
Access the window object to call the following methods:
- Find the value of the 
innerWidthof the window. - Search for the 
window.scrollTo()method on MDN. Read the description and the examples, and try using it in the DevTools console. - Call on the method in 
window.locationthat reloads the page you are on. If you can't remember the name of the method, review the lesson "Accessing Window Properties" or try researching on MDN.