Which property in the Window object is used to refer to a Location object?
a) position
b) area
c) window
d) location
Explanation: The Window object defines properties like location, which refers to a Location object that specifies the URL currently displayed in the window and allows a script to load a new URL into the window. The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page.
Which Window object method is used to display a message in a dialog box?
a) alert()
b) prompt()
c) message()
d) console.log
Explanation: The Window object defines methods like alert(), which displays a message in a dialog box. A prompt message can be displayed on the screen using alert().
The setTimeout() method is used to……
a) Make the event sleep
b) Register a function to be invoked after a certain time
c) Invoke an event after a certain time
d) Time for iteration
Explanation: The setTimeout(), which registers a function to be invoked after a specified amount of time. The setTimeout() method calls a function or evaluates an expression after a specified number of milliseconds.
Which of the following is a global object?
a) Register
b) Location
c) Window
d) Position
Explanation: In client-side JavaScript, the Window object is also the global object. This means that the Window object is at the top of the scope chain and that its properties and methods are effectively global variables and global functions.
When will the window property come into play?
a) Representation convenience
b) Use as an extension of other objects
c) Use objects in the Window object
d) Refer to window object itself
Explanation: The Window object has a property named window that always refers to itself. You can use this property if you need to refer to the window object itself.
Which is the property that represents the content displayed in the window?
a) document
b) content
c) window
d) frame
Explanation: One of the most important properties of the Window object is document: it refers to a Document object that represents the content displayed in the window.