JavaScript Language | 10 Minute‐Test 24


Instruction

  • Total number of questions : 10.
  • Time alloted : 10 minutes.
  • Each question carry 1 mark.
  • No Negative marks
  • DO NOT refresh the page.
  • All the best :-).

1.

The localStorage and sessionStorage belongs to

A.
Window object
B.
Element object
C.
Hash object
D.
DOM object

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

Browsers that implement the “Web Storage” draft specification define two properties on the Window object: localStorage and sessionStorage. Both properties refer to a Storage object—a persistent associative array that maps string keys to string values.

2.

What is the code to start displaying the time when document loads?

A.
onload = displayTime;
B.
window. = displayTime;
C.
window.onload = displayTime; 
D.
window.onload = start;

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The above code starts displaying the time when the document loads.

3.

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

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The setTimeout(), which registers a function to be invoked after a specified amount of time.

4.

When a program contains extensive use of event handlers, which of the following is necessary?

A.
Modular functions
B.
Nested functions
C.
Split up programs
D.
All of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

Nested functions are common in client-side JavaScript, because of its extensive use of event handlers.

5.

What does Dojo and YUI have in common?

A.
Facilitates DOM utilities and UI Widgets
B.
Doesnot facilitates DOM utilities and UI Widgets
C.
Client-side library
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

Like Dojo, it is a large, all-encompassing library with language utilities, DOM utilities, UI widgets, and so on. There are actually two incompatible versions of YUI, known as YUI 2 and YUI 3.

6.

The setTimeout() belongs to which object?

A.
Element
B.
Window
C.
Location
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The setTimeout() method of the Window object schedules a function to run after a specified number of milliseconds elapses.

7.

The decodeURIComponent() is defined by

A.
Server-side JavaScript
B.
Client-side JavaScript
C.
Both a and b
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The decodeURIComponent() is a global function defined by client-side JavaScript.

8.

The navigator property belongs to which of the following object?

A.
Document
B.
Window
C.
Navigator
D.
Location

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The navigator property of a Window object refers to a Navigator object that contains browser vendor and version number information.

9.

What will happen if the first argument of open() is omitted?

A.
Error Page
B.
about:blank
C.
Remains in the same page
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

When the first argument of the open() is omitted, the about:blank is opened.

10.

Which of the following is/are of Text nodes?

A.
Text
B.
Comment
C.
Both a and b
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

Both Text and Comment are basically strings of text, and these nodes are much like the Text nodes that represent the displaying text of a document.


Submit your test now to view the Results and Statistics with answer explanation.