CommerceClasses 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?
- A. Highly memory consuming
- B. Functions should access the global objects
- C. Functions should not access the global objects
- D. Very inefficient to use
Correct Answer: C
Which is the subset that is a secure container designed for the purpose of safely running untrusted JavaScript?
- A. Sandbox
- B. The Good Parts
- C. Both Sandbox and Good Parts
- D. None of the mentioned
Correct Answer: A
Why was “The Good Parts” designed as a language subset in JavaScript?
- A. To improve programmer flexibility
- B. To balance the work load of the programmer
- C. To create an in-built compiler and interpreter
- D. To improve programmer productivity
Correct Answer: D
What is being imposed on each subset to ensure that it conforms to the subset?
- A. A parser to parse the code
- B. A parser that parses and adds to the subset
- C. A static verifier that parses code
- D. All of the mentioned
Correct Answer: C
Why does JavaScript subset disallow == and !=?
- A. It uses bitwise checking
- B. It uses === and !== instead
- C. It uses equals() and notequals() instead
- D. None of the mentioned
Correct Answer: B
The Crockford’s subset doesnot include which function in JavaScript?
- A. eval()
- B. coeval()
- C. equal()
- D. equivalent()
Correct Answer: A
What would be the result of the following statement in JavaScript using regular expression methods ?
- A. Returns [“123″”456″”789”]
- B. Returns [“123″,”456″,”789”]
- C. Returns [1,2,3,4,5,6,7,8,9]
- D. Throws an exception
Correct Answer: B
The method that performs the search-and-replace operation to strings for pattern matching is
- A. searchandreplace()
- B. add()
- C. edit()
- D. replace()
Correct Answer: B
What is the most essential purpose of parantheses in regular expressions ?
- A. Define pattern matching techniques
- B. Define subpatterns within the complete pattern
- C. Define portion of strings in the regular expression
- D. All of the mentioned
Correct Answer: B
What does the subexpression /java(script)?/ result in ?
- A. It matches “java” followed by the optional “script”
- B. It matches “java” followed by any number of “script”
- C. It matches “java” followed by a minimum of one “script”
- D. None of the mentioned
Correct Answer: A
What will be the result when non greedy repetition is used on the pattern /a+?b/ ?
- A. Matches the letter b preceded by the fewest number of a’s possible
- B. Matches the letter b preceded by any number of a
- C. Matches letter a preceded by letter b, in the stack order
- D. None of the mentioned
Correct Answer: A
What does /[^(]* regular expression indicate ?
- A. Match one or more characters that are not open paranthesis
- B. Match zero or more characters that are open paranthesis
- C. Match zero or more characters that are not open paranthesis
- D. Match one or more characters that are open paranthesis
Correct Answer: C