What is the result of the following code snippet? [code] window.location === document.location [/code]

What is the result of the following code snippet?
Code:
window.location === document.location
A. False
B. True
C. 0
D. 1
 
Answer: b
Explanation: The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The Document.location read-only property returns a Location object, which contains information about the URL of the document and provides methods for changing that URL and loading another URL.
 

Tìm kiếm

Back
Top