Vidyalelo
JavaScript · Q23

Classes And Modules

Programming · JavaScript · question 23

Q23

Consider the following statement var Set = sets.Set; var s = new Set(1,2,3); What could be the efficiency quotient of the above two statements ?

A.
The programmer imports at once the frequently used values into the global namespace
Answer
B.
There is no efficiency quotient, the programmer tries to make it inefficient
C.
The programmer needs to import the Sets everytime he wants to use it
D.
All of the mentioned

Answer: Option A

Solution

Answer: Option A
Solution:
A programmer can import frequently used values into the global namespace. A programmer who was going to make frequent use of the Set class from the sets namespace might import the class like that.