JavaScript MCQs with answers Page - 53

Here, you will find a collection of MCQ questions on JavaScript. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833K Points
Coach

Q. The meaning for Augmenting classes is that

  • (A) objects inherit prototype properties even in dynamic state
  • (B) objects inherit prototype properties only in dynamic state
  • (C) objects inherit prototype properties in static state
  • (D) None of these

A

Admin • 833K Points
Coach

Q. Consider the following code snippet :

Code:
var o = new F();
o.constructor === F
  • (A) false
  • (B) true
  • (C) 0
  • (D) 1

A

Admin • 833K Points
Coach

Q. 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(…)

A

Admin • 833K Points
Coach

Q. 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;

A

Admin • 833K Points
Coach

Q. The property of JSON() method is

  • (A) it can be invoked manually as object.JSON()
  • (B) it will be automatically invoked by the compiler
  • (C) it is invoked automatically by the JSON.stringify() method
  • (D) it cannot be invoked in any form

A

Admin • 833K Points
Coach

Q. When a class B can extend another class A, we say that

  • (A) A is the superclass and B is the subclass
  • (B) B is the superclass and A is the subclass
  • (C) Both A and B are the superclass
  • (D) Both A and B are the subclass

A

Admin • 833K Points
Coach

Q. The method that can be used to create new properties and also to modify the attributes of existing properties is

  • (A) Both Object.defineProperty() and Object.defineProperties()
  • (B) Object.defineProperties()
  • (C) Object.defineProperty()
  • (D) None

A

Admin • 833K Points
Coach

Q. The snippet that filters the filtered set is

  • (A) var t=new FilteredSet(s, {function(s) {return !(x instanceof Set);});
  • (B) var t=new FilteredSet{function(s) {return !(x instanceof Set);});
  • (C) var t=new FilteredSet(s, {function(s) {return (x instanceof Set);});
  • (D) var t=new FilteredSet(s, {function(s) {return x;});

A

Admin • 833K Points
Coach

Q. If A is the superclass and B is the subclass, then subclass inherting the superclass can be represented as

  • (A) B=inherit(A);
  • (B) B=A.inherit();
  • (C) B.prototype=inherit(A);
  • (D) B.prototype=inherit(A.prototype);

A

Admin • 833K Points
Coach

Q. 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));

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ