JavaScript Language | 10 Minute‐Test 25


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.

What is the main difference between localStorage and sessionStorage?

A.
Lifetime
B.
Scope
C.
Both a and b
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The difference between localStorage and sessionStorage has to do with lifetime and scope: how long the data is saved for and who the data is accessible to.

2.

One of the main advantage of using src attribute is

A.
It becomes self-cached
B.
It makes the HTML file modular
C.
It restricts manipulation in the HTML file
D.
It simplifies the HTML files

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The main advantage of using the src attribute is that it simplifies your HTML files by allowing you to remove large blocks of JavaScript code from them—that is, it helps keep content and behavior separate.

3.

Which of the following is a global object?

A.
Register
B.
Location
C.
Window
D.
Position

Your Answer: Option (Not Answered)

Correct Answer: Option C

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.

4.

Which of the following is not an object?

A.
Element
B.
Location
C.
Position
D.
Window

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

There is no object called Position.

5.

What are the two incompatible versions of YUI?

A.
YUI2 and YUI3
B.
YUI2 and YUI4
C.
YUI1 and YUI3
D.
YUI1 and YUI2

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.

Which method receives the return value of setTimeout() to cancel future invocations?

A.
clearTimeout()
B.
clearInterval()
C.
clearSchedule()
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

setTimeout() returns a value that can be passed to clearTimeout() to cancel the execution of the scheduled function.

7.

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()

Your Answer: Option (Not Answered)

Correct Answer: Option C

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().

8.

What is the vendor-neutral synonym for navigator?

A.
staticData
B.
purposeInformation
C.
dataInformation
D.
clientInformation

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

IE supports clientInformation as a vendor-netural synonym for navigator.

9.

Which object serves as the global object at the top of the scope chain?

A.
Hash
B.
Property
C.
Element
D.
Window

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The Window object serves as the global object at the top of the scope chain in client-side JavaScript.

10.

Which is one of way to query a document for an element or elements?

A.
With a specified id attribute
B.
Matching the specified CSS selector
C.
With the specified tag name
D.
All of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The DOM defines a number of ways to select elements; you can query a document for an element or elements:
1.with a specified id attribute;
2.with a specified name attribute;
3.with the specified tag name;
4.with the specified CSS class or classes; or
5.matching the specified CSS selector


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