Goal: In the "Accessing Window Properties" lesson, we learned:
windowproperty itself is an object with properties, we can chain dot notation to access the nested object's property. A good example of this is
window.location.href, where we're accessing the
windowobject's property called
location, and then we're accessing the
locationobject's property called
Begin familiarizing yourself with the
window object by completing the following exercises in the DevTools console.
windowobject represent? What sort of information can we get from it?
window object to find the following information:
innerHeightof the window.
hrefof the webpage you are currently on.
window.screenproperty in your console, and expand the object so that you can see the properties. Then, access the
heightproperty of the
screenobject. Turn the
heightproperty into a string.
window object to call the following methods:
innerWidthof the window.
window.scrollTo()method on MDN. Read the description and the examples, and try using it in the DevTools console.
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.