Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSteven Romano
10,024 Pointswindow.location what does it mean
I understand what the last line in the video ( window.location = $select.val();
) does. What is the proper terms for them and is the window
called something and the .location
called something else. I'm asking because I don't want to sound like I don't know what I'm talking about when I say what they are.
2 Answers
Aaron Graham
18,033 PointsThe Window
is a javascript object and has attributes and methods associated with it. The location
attribute describes the current location as indicated in the browser address bar. This may shed a little more light on the subject: Window.location
Edit: Dino Paškvan beat me to it.
Dino Paškvan
Courses Plus Student 44,108 Pointswindow
is an object. In fact, when talking about JavaScript in the browser, it could be said that it's the object. window
is a global object and all the variables declared inside the global scope are actually properties on that object.
location
is a property on the global window
object.
For more info, check the MDN documentation on Window and Window.location.