JavaScript BOM Essentials Quiz Quiz

  1. Window Object Basics

    Which property of the window object gives access to the browser's viewport inner width in pixels?

    1. window.innerWidth
    2. window.frameWidth
    3. window.widthInner
    4. window.outerHeight
    5. window.viewportSize
  2. Navigator Object

    What property of the navigator object reveals the name of the browser in use?

    1. navigator.browserName
    2. navigator.appName
    3. navigator.userAgentName
    4. navigator.application
    5. navigator.windowName
  3. Screen Properties

    To get the full width of the user's screen in pixels, which property is used?

    1. window.innerScreen
    2. screen.length
    3. screen.screenWidth
    4. window.screenLength
    5. screen.width
  4. Pop-Up Windows

    Which window method can be used to open a new browser window or tab with a specific URL?

    1. window.create()
    2. window.popUp()
    3. window.launch()
    4. window.spawn()
    5. window.open()
  5. History Navigation

    What is the method to move the browser forward one page in the session history?

    1. history.ahead()
    2. history.goNext()
    3. history.move()
    4. window.next()
    5. history.forward()
  6. User Agent Information

    Which navigator property contains a string identifying the browser and operating system?

    1. navigator.userAgent
    2. navigator.platformAgent
    3. navigator.deviceID
    4. navigator.browserCode
    5. navigator.systemName
  7. Timers: setTimeout

    Which timer method runs a function once after a specified delay in milliseconds?

    1. setTimer()
    2. setTimeout()
    3. runAfter()
    4. timeoutCall()
    5. setInterval()
  8. Timers: setInterval

    If you want a function to execute repeatedly every 500 milliseconds, which method should you use?

    1. setInterval()
    2. repeatTimeout()
    3. runEvery()
    4. doInterval()
    5. intervalCall()
  9. Canceling Timers

    If you assign a setTimeout timer to a variable called timerId, which method stops it before it fires?

    1. cancelSetTimeout(timerId)
    2. stopTimeout(timerId)
    3. endTimeout(timerId)
    4. clearTimeout(timerId)
    5. removeTimer(timerId)
  10. Getting Screen Height

    Which JavaScript property retrieves the total height of the user's display screen?

    1. screen.height
    2. screen.length
    3. screen.sizeY
    4. window.screenHeight
    5. screen.resolutionY
  11. Detecting Online Status

    Which property of the navigator object tells you if the browser is currently connected to the internet?

    1. navigator.onLine
    2. navigator.isInternet
    3. navigator.internet
    4. navigator.connected
    5. navigator.onlineStatus
  12. Window Alerts

    What is the correct method to display a simple alert dialog to the user?

    1. window.showAlert()
    2. window.alert()
    3. window.wakeup()
    4. window.notify()
    5. window.popupAlert()
  13. History Object Length

    Which property shows how many entries are in the session history for the current page?

    1. history.size
    2. window.historyMax
    3. sessionHistory
    4. history.count
    5. history.length
  14. Clearing Intervals

    Given an interval set with setInterval and stored in intervalId, which method would stop it from running?

    1. cancelInterval(intervalId)
    2. stopSetInterval(intervalId)
    3. window.clearInt(intervalId)
    4. clearInterval(intervalId)
    5. deleteInterval(intervalId)
  15. Blank Window Reference

    What does the window property 'self' refer to in the context of the window object?

    1. The current window itself
    2. The opener window
    3. The main screen object
    4. The parent window
    5. A reference to the browser