Sail E0 Webinar

MCQs

Total Questions : 67 | Page 3 of 7 pages
Question 21. The maximum number of global symbols a module can define is
  1.    2
  2.    3
  3.    1
  4.    4
 Discuss Question
Answer: Option C. -> 1
Question 22. To define each of the set classes as a property of the sets object (namespace) for the module, the statement is
  1.    sets = sets.AbstractEnumerableSet.extend();
  2.    sets.SingletonSet = sets.AbstractEnumerableSet.extend(...);
  3.    sets.SingletonSet = sets.extend(...);
  4.    sets = sets.extend(...);
 Discuss Question
Answer: Option B. -> sets.SingletonSet = sets.AbstractEnumerableSet.extend(...);
Question 23. 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 ?
  1.    The programmer imports at once the frequently used values into the global namespace
  2.    There is no efficiency quotient, the programmer tries to make it inefficient
  3.    The programmer needs to import the Sets everytime he wants to use it
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> The programmer imports at once the frequently used values into the global namespace
Question 24. The scope of a function is also called as
  1.    The function’s scope
  2.    Module function
  3.    Modulated function
  4.    Private function
 Discuss Question
Answer: Option B. -> Module function
Question 25. Modules that have more than one item in their API can
  1.    Assign itself to a global variable
  2.    Invoke another module of the same kind
  3.    Return a namespace object
  4.    Invoke another module of the same kind
 Discuss Question
Answer: Option C. -> Return a namespace object
Question 26. The provides() function and the exportsobject are used to
  1.    Register the module’s API and Store their API
  2.    Store the module’s API and register their API
  3.    Store the module’s API
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Register the module’s API and Store their API
Question 27. Consider the following code snippet
var sets = com.davidflanagan.collections.sets;
What is the programmer trying to do in the above code snippet?
  1.    Importing a single module
  2.    Importing a module partially
  3.    Importing a namespace
  4.    Importing the entire module
 Discuss Question
Answer: Option D. -> Importing the entire module
Question 28. The properties() method is a
  1.    Enumerable method
  2.    Non-enumerable method
  3.    Operational method
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Non-enumerable method
Question 29. The ‘$’ present in the RegExp object is called a
  1.    character
  2.    matcher
  3.    metacharacter
  4.    metadata
 Discuss Question
Answer: Option C. -> metacharacter
Question 30. What can be done in order to avoid creation of global variables in JavaScript?
  1.    To use a method that defines all the variables
  2.    To use an object that has the reference to all the variables
  3.    To use an object as its namespace
  4.    To use global functions
 Discuss Question
Answer: Option C. -> To use an object as its namespace

Latest Videos

Latest Test Papers