What is the purpose of the window.location object in JavaScript?

A Get the URL and redirect
B Get the location of the cursor
C Get the path to the next page
D Get the location & path of the next page

Correct Answer: Get the URL and redirect

The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The parameter location specifies the agent location, speed and browser to use for the test, formatted as location.browser:location.

Related Questions

Which of the following are client-side JavaScript object?
How do we get the DOM object in JavaScript?
How do we create and preload an image object in JavaScript?
What is the purpose of the event handlers in the JavaScript?

Next steps