CommerceClasses 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
- A. […]
- B. [^]
- C. [^…]
- D. [D]
Correct Answer: C
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
- A. text==pattern
- B. text.equals(pattern)
- C. text.test(pattern)
- D. pattern.test(text)
Correct Answer: D
The ‘$’ present in the RegExp object is called a
- A. character
- B. matcher
- C. metacharacter
- D. metadata
Correct Answer: C
What can be done in order to avoid creation of global variables in JavaScript?
- A. To use a method that defines all the variables
- B. To use an object that has the reference to all the variables
- C. To use an object as its namespace
- D. To use global functions
Correct Answer: C
The properties() method is a
- A. Enumerable method
- B. Non-enumerable method
- C. Operational method
- D. None of the mentioned
Correct Answer: B
Consider the following code snippet var sets = com . davidflanagan . collections . sets; What is the programmer trying to do in the above code snippet?
- A. Importing a single module
- B. Importing a module partially
- C. Importing a namespace
- D. Importing the entire module
Correct Answer: D
The provides() function and the exportsobject are used to
- A. Register the module’s API and Store their API
- B. Store the module’s API and register their API
- C. Store the module’s API
- D. None of the mentioned
Correct Answer: A
Modules that have more than one item in their API can
- A. Assign itself to a global variable
- B. Invoke another module of the same kind
- C. Return a namespace object
- D. None of the above
Correct Answer: C
The scope of a function is also called as
- A. The function’s scope
- B. Module function
- C. Modulated function
- D. Private function
Correct Answer: B
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
- 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
Correct Answer: A
To define each of the set classes as a property of the sets object (namespace) for the module, the statement is
- A. sets = sets.AbstractEnumerableSet.extend()
- B. sets.SingletonSet = sets.AbstractEnumerableSet.extend(...)
- C. sets.SingletonSet = sets.extend(...)
- D. sets = sets.extend(...)
Correct Answer: B
The maximum number of global symbols a module can define is
- A. 2
- B. 3
- C. 1
- D. 4
Correct Answer: C