Commerce

Classes And Modules MCQs

Practice Classes And Modules MCQs for competitive exams.

Classes And Modules MCQs

Practice questions from this topic.

Why is the this keyword forbidden in JavaScript?

  1. A. Highly memory consuming
  2. B. Functions should access the global objects
  3. C. Functions should not access the global objects
  4. D. Very inefficient to use
Report Error

Which is the subset that is a secure container designed for the purpose of safely running untrusted JavaScript?

  1. A. Sandbox
  2. B. The Good Parts
  3. C. Both Sandbox and Good Parts
  4. D. None of the mentioned
Report Error

Why was “The Good Parts” designed as a language subset in JavaScript?

  1. A. To improve programmer flexibility
  2. B. To balance the work load of the programmer
  3. C. To create an in-built compiler and interpreter
  4. D. To improve programmer productivity
Report Error

What is being imposed on each subset to ensure that it conforms to the subset?

  1. A. A parser to parse the code
  2. B. A parser that parses and adds to the subset
  3. C. A static verifier that parses code
  4. D. All of the mentioned
Report Error

Why does JavaScript subset disallow == and !=?

  1. A. It uses bitwise checking
  2. B. It uses === and !== instead
  3. C. It uses equals() and notequals() instead
  4. D. None of the mentioned
Report Error

The Crockford’s subset doesnot include which function in JavaScript?

  1. A. eval()
  2. B. coeval()
  3. C. equal()
  4. D. equivalent()
Report Error

What would be the result of the following statement in JavaScript using regular expression methods ?

  1. A. Returns [“123″”456″”789”]
  2. B. Returns [“123″,”456″,”789”]
  3. C. Returns [1,2,3,4,5,6,7,8,9]
  4. D. Throws an exception
Report Error

The method that performs the search-and-replace operation to strings for pattern matching is

  1. A. searchandreplace()
  2. B. add()
  3. C. edit()
  4. D. replace()
Report Error

What is the most essential purpose of parantheses in regular expressions ?

  1. A. Define pattern matching techniques
  2. B. Define subpatterns within the complete pattern
  3. C. Define portion of strings in the regular expression
  4. D. All of the mentioned
Report Error

What does the subexpression /java(script)?/ result in ?

  1. A. It matches “java” followed by the optional “script”
  2. B. It matches “java” followed by any number of “script”
  3. C. It matches “java” followed by a minimum of one “script”
  4. D. None of the mentioned
Report Error

What will be the result when non greedy repetition is used on the pattern /a+?b/ ?

  1. A. Matches the letter b preceded by the fewest number of a’s possible
  2. B. Matches the letter b preceded by any number of a
  3. C. Matches letter a preceded by letter b, in the stack order
  4. D. None of the mentioned
Report Error

What does /[^(]* regular expression indicate ?

  1. A. Match one or more characters that are not open paranthesis
  2. B. Match zero or more characters that are open paranthesis
  3. C. Match zero or more characters that are not open paranthesis
  4. D. Match one or more characters that are open paranthesis
Report Error