Q. What is the function used to extract arguments from the search property of a URL?

  • (A) urlArgs()
  • (B) url()
  • (C) hash()
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) urlArgs()
Explanation: The urgArgs() function can be used to extract arguments from the search property of a URL.

Q. The decodeURIComponent() is defined by

  • (A) Server-side JavaScript
  • (B) Client-side JavaScript
  • (C) Both Server-side and Client-side JavaScript
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Client-side JavaScript
Explanation: The decodeURIComponent() is a global function defined by client-side JavaScript.

Q. Which is the method that removes the current document from the browsing history before laoding the new document?

  • (A) modify()
  • (B) assign()
  • (C) replace()
  • (D) remove()
πŸ’¬ Discuss
βœ… Correct Answer: (C) replace()
Explanation: The replace() method is similar, but it removes the current document from the browsing history before loading the new document. When a script unconditionally loads a new document, the replace() method is often a better choice than assign().

Q. Why is the replace() method better than the assign() method?

  • (A) Reliable
  • (B) Highly managable
  • (C) More efficient
  • (D) Handles unconditional loading
πŸ’¬ Discuss
βœ… Correct Answer: (D) Handles unconditional loading
Explanation: The replace() method is similar, but it removes the current document from the browsing history before loading the new document. When a script unconditionally loads a new document, the replace() method is often a better choice than assign().

Q. What is the purpose of the assign() method?

  • (A) Only loading
  • (B) Loading of window and display
  • (C) Displays already present window
  • (D) Unloading of window
πŸ’¬ Discuss
βœ… Correct Answer: (B) Loading of window and display
Explanation: The assign() method of the Location object makes the window load and display the document at the URL you specify.

Q. The history property belongs to which object?

  • (A) Element
  • (B) Window
  • (C) History
  • (D) Location
πŸ’¬ Discuss
βœ… Correct Answer: (C) History
Explanation: The history property of the Window object refers to the History object for the window.

Q. Which function among the following lets to register a function to be invoked once?

  • (A) setTimeout()
  • (B) setTotaltime()
  • (C) setInterval()
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) setTimeout()
Explanation: setTimeout() and setInterval() allow you to register a function to be invoked once or repeatedly after a specified amount of time has elapsed.

Q. Which function among the following lets to register a function to be invoked repeatedly after a certain time?

  • (A) setTimeout()
  • (B) setTotaltime()
  • (C) setInterval()
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) setInterval()
Explanation: setTimeout() and setInterval() allow you to register a function to be invoked once or repeatedly after a specified amount of time has elapsed.

Q. Which is the handler method used to invoke when uncaught JavaScript exceptions occur?

  • (A) Onhalt
  • (B) Onerror
  • (C) Both onhalt and onerror
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Onerror
Explanation: The onerror handler method can be registered to be invoked when uncaught JavaScript exceptions occur.

Q. Which property is used to obtain browser vendor and version information?

  • (A) modal
  • (B) version
  • (C) browser
  • (D) navigator
πŸ’¬ Discuss
βœ… Correct Answer: (D) navigator
Explanation: The navigator property is used to obtain browser vendor and version information.