What will be the efficiency quotient of the following JavaScript statements? [code] var Set = sets.Set; var s = new Set(1,2,3); [/code]

What will be the efficiency quotient of the following JavaScript statements?
Code:
var Set = sets.Set;
var s = new Set(1,2,3);
A. The programmer imports at once the frequently used values into the global namespace
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. the programmer imports the set everytime the statement is encountered
 
Answer: a
Explanation: 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.
 

Tìm kiếm

Back
Top