wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Understanding BOM in JavaScript (11R)

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What does BOM stand for in JavaScript?

a)

Browser Object Model

b)

Basic Object Model

c)

Browser Output Model

d)

Binary Object Model

2.

Which object is the primary interface for the BOM?

a)

console

b)

navigator

c)

document

d)

window

3.

How can you access the browser's window object in JavaScript?

a)

Use 'document' to access the browser's window object.

b)

Use 'window' to access the browser's window object.

c)

The window object is accessed through 'navigator' in JavaScript.

d)

Access the window object by calling 'getWindow()'.

4.

What method would you use to open a new browser window?

a)

Use Alt + F4 to close the browser

b)

Click on the browser icon on the desktop

c)

Use Ctrl + N or Command + N keyboard shortcut.

d)

Right-click and select 'Open New Window'

5.

How do you get the current URL of the window?

a)

document.URL

b)

window.currentURL

c)

window.location

d)

window.location.href

6.

What is the purpose of the `navigator` object in the BOM?

a)

The purpose of the `navigator` object is to provide information about the web browser and the operating system.

b)

To control the rendering of web pages.

c)

To manage browser cookies and sessions.

d)

To store user preferences for the browser.

7.

How can you detect the user's browser using JavaScript?

a)

Use 'document.title' to get the browser name.

b)

Check the 'window.location' for browser type.

c)

Use 'navigator.userAgent' to get the browser information.

d)

Use 'navigator.language' to determine the browser.

8.

What does the `screen` object provide access to?

a)

Access to file system properties such as storage and permissions.

b)

Access to screen properties such as width, height, and color depth.

c)

Access to audio properties such as volume and balance.

d)

Access to network properties such as speed and latency.

9.

How can you change the size of the current browser window?

a)

Use the browser's print feature to adjust layout

b)

Change the screen resolution in system settings

c)

Press F11 to enter fullscreen mode

d)

Use the browser's window resizing feature or JavaScript methods like window.resizeTo.

10.

What is the difference between `window.alert()` and `console.log()`?

a)

`window.alert()` is for user notifications, while `console.log()` is for debugging.

b)

`window.alert()` is used for logging errors, while `console.log()` is for user notifications.

c)

`window.alert()` displays messages in the console, while `console.log()` shows alerts to users.

d)

`window.alert()` is asynchronous, while `console.log()` is synchronous.

11.

How can you navigate to a different URL using the BOM?

a)

Use 'window.location.href = "newURL";' to navigate to a different URL.

b)

Use 'document.navigateTo('newURL');' to change the URL.

c)

Set 'window.url = 'newURL';' to redirect to a new page.

d)

Invoke 'location.replace('newURL');' to open a different URL.

12.

What method would you use to close the current window?

a)

Use 'Ctrl + Q' to quit the application.

b)

Use 'Ctrl + W' or 'Command + W' to close the current window.

c)

Press 'Alt + F4' to close the current window.

d)

Select 'File' then 'Exit' from the menu.

13.

How can you retrieve the dimensions of the browser window?

a)

Use 'document.body.clientWidth' and 'document.body.clientHeight' to get the dimensions.

b)

Call 'getDimensions()' method from the browser API to retrieve window size.

c)

Use 'window.innerWidth' and 'window.innerHeight' to get the browser window dimensions.

d)

Access 'window.size' property to find the dimensions of the browser window.

14.

What is the role of the `history` object in the BOM?

a)

The `history` object is used to clear the browser cache.

b)

The `history` object allows navigation through the browser's session history.

c)

The `history` object stores user preferences for the browser.

d)

The `history` object manages cookies in the browser.

15.

How can you manipulate the browser's history using JavaScript?

a)

Use the Document Object Model (DOM) methods: createElement() and appendChild() to manipulate history.

b)

Use the History API methods: pushState(), replaceState(), and go() to manipulate the browser's history.

c)

Call the alert() function to display the history entries.

d)

Use the console.log() method to view the history without making changes.