Commerce

Classes And Modules MCQs

Practice Classes And Modules MCQs for competitive exams.

Classes And Modules MCQs

Practice questions from this topic.

The regular expression to match any one character not between the brackets is

  1. A. […]
  2. B. [^]
  3. C. [^…]
  4. D. [D]
Report Error

Consider the following statement containing regular expressions var text = "testing: 1, 2, 3" ; var pattern = / d +/ g; In order to check if the pattern matches, the statement is

  1. A. text==pattern
  2. B. text.equals(pattern)
  3. C. text.test(pattern)
  4. D. pattern.test(text)
Report Error

The ‘$’ present in the RegExp object is called a

  1. A. character
  2. B. matcher
  3. C. metacharacter
  4. D. metadata
Report Error

What can be done in order to avoid creation of global variables in JavaScript?

  1. A. To use a method that defines all the variables
  2. B. To use an object that has the reference to all the variables
  3. C. To use an object as its namespace
  4. D. To use global functions
Report Error

The properties() method is a

  1. A. Enumerable method
  2. B. Non-enumerable method
  3. C. Operational method
  4. D. None of the mentioned
Report Error

Consider the following code snippet var sets = com . davidflanagan . collections . sets; What is the programmer trying to do in the above code snippet?

  1. A. Importing a single module
  2. B. Importing a module partially
  3. C. Importing a namespace
  4. D. Importing the entire module
Report Error

The provides() function and the exportsobject are used to

  1. A. Register the module’s API and Store their API
  2. B. Store the module’s API and register their API
  3. C. Store the module’s API
  4. D. None of the mentioned
Report Error

Modules that have more than one item in their API can

  1. A. Assign itself to a global variable
  2. B. Invoke another module of the same kind
  3. C. Return a namespace object
  4. D. None of the above
Report Error

The scope of a function is also called as

  1. A. The function’s scope
  2. B. Module function
  3. C. Modulated function
  4. D. Private function
Report Error

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. A. The programmer imports at once the frequently used values into the global namespace
  2. B. There is no efficiency quotient, the programmer tries to make it inefficient
  3. C. The programmer needs to import the Sets everytime he wants to use it
  4. D. All of the mentioned
Report Error

To define each of the set classes as a property of the sets object (namespace) for the module, the statement is

  1. A. sets = sets.AbstractEnumerableSet.extend()
  2. B. sets.SingletonSet = sets.AbstractEnumerableSet.extend(...)
  3. C. sets.SingletonSet = sets.extend(...)
  4. D. sets = sets.extend(...)
Report Error

The maximum number of global symbols a module can define is

  1. A. 2
  2. B. 3
  3. C. 1
  4. D. 4
Report Error