CommerceClasses And Modules MCQs
Practice Classes And Modules MCQs for competitive exams.
Classes And Modules MCQs
Practice questions from this topic.
What is the code required to delete all “weight” tags?
- A. delete weight(pt).all
- B. delete pt.element[all]
- C. delete pt
- D. delete pt..weight
Correct Answer: D
Which of the following is an example to perform the most common XML manipulations using the XML objects invocation?
- A. insertChildBefore()
- B. insertChildAfter()
- C. appendChildAfter(…)
- D. appendChildBefore(…)
Correct Answer: A
Which of the following is the descendant operator?
- A. ..
- B. …
- C. *
- D. @
Correct Answer: B
Which method to use while working with XML fragments, instead of XML()?
- A. XMLInterface()
- B. XMLClass()
- C. XMLList()
- D. XMLArray()
Correct Answer: C
What is the return type of typeof for standard JavaScript objects?
- A. xml
- B. object
- C. dom
- D. html
Correct Answer: B
When will the finally block be called?
- A. When there is no exception
- B. When the catch doesnot match
- C. When there is exception
- D. None of the mentioned
Correct Answer: D
What will be the reaction when a catch clause has no conditionals ?
- A. Takes it to be 0
- B. Takes it to be 1
- C. Takes it to be true
- D. Takes it to be false
Correct Answer: C
What is the code to be used to trim whitespaces ?
- A. let trimmed = (l.trim() for (l in lines))
- B. let trimmed = (trim(l))
- C. let trimmed = l.trim()
- D. let trimmed = for(l in lines))
Correct Answer: A
Consider the following code snippet data . sort (function( a,b ) ,b - a ) ; What does the above code do?
- A. Sort in the alphabetical order
- B. Sort in the chronological order
- C. Sort in reverse alphabetical order
- D. Sort in reverse numerical order
Correct Answer: D
Consider the following code snippet let succ = function ( x ) x + 1 , yes = function () true , no = function () false ; What convenience does the above code snippet provide?
- A. Functional behaviour
- B. Modular behaviour
- C. No convenience
- D. Shorthand expression
Correct Answer: A
Which method of the iterable object returns an iterator object for the collection?
- A. iterator()
- B. _iterator_()
- C. _iteration_()
- D. _return_iterator_()
Correct Answer: B
Which exception does the Iterators throw from their next() method when there are no more values to iterate, that work on finite collections ?
- A. ExitIteration
- B. AbortIteration
- C. Abort
- D. StopIteration
Correct Answer: D