JavaScript MCQs with answers Page - 69

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. A linkage of series of prototype objects is called as :

  • (A) prototype stack
  • (B) prototype chain
  • (C) prototype class
  • (D) prototypes

A

Admin • 833K Points
Coach

Q. Consider the below given syntax
book[datatype]=assignment_value;
In the above syntax, the datatype within the square brackets must be

  • (A) An integer
  • (B) A String
  • (C) An object
  • (D) None of the mentioned

A

Admin • 833K Points
Coach

Q. Consider the following code snippet
function f() {};
The above prototype represents a

  • (A) Function f
  • (B) A custom constructor
  • (C) Prototype of a function
  • (D) Not valid

A

Admin • 833K Points
Coach

Q. Identify the process done in the below code snippet
o = {x:1, y:{z:[false,null,""]}};
s = JSON.stringify(o);
p = JSON.parse(s);

  • (A) Object Encapsulation
  • (B) Object Serialization
  • (C) Object Abstraction
  • (D) Object Encoding

A

Admin • 833K Points
Coach

Q. Javascript is _________ language.

  • (A) Programming
  • (B) Application
  • (C) None of These
  • (D) Scripting

A

Admin • 833K Points
Coach

Q. Consider the following code snippet
function printArray(a)
{
var len = a.length, i = 0;
if (len == 0)
console.log("Empty Array");
else
{
do
{
console.log(a[i]);
} while (++i < len);
}
}
What does the above code result?

  • (A) Prints the numbers in the array in order
  • (B) Prints the numbers in the array in the reverse order
  • (C) Prints 0 to the length of the array
  • (D) Prints “Empty Array”

A

Admin • 833K Points
Coach

Q. What are the three important manipulations done in a for loop on a loop variable?

  • (A) Updation, Incrementation, Initialization
  • (B) Initialization,Testing, Updation
  • (C) Testing, Updation, Testing
  • (D) Initialization,Testing, Incrementation

A

Admin • 833K Points
Coach

Q. Consider the following code snippet
function tail(o)
{
for (; o.next; o = o.next) ;
return o;
}
Will the above code snippet work? If not, what will be the error?

  • (A) No, this will throw an exception as only numerics can be used in a for loop
  • (B) No, this will not iterate
  • (C) Yes, this will work
  • (D) No, this will result in a runtime error with the message “Cannot use Linked List”

A

Admin • 833K Points
Coach

Q. One of the special feature of an interpreter in reference with the for loop is that

  • (A) Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
  • (B) The iterations can be infinite when an interpreter is used
  • (C) The body of the loop is executed only once
  • (D) All of the mentioned

A

Admin • 833K Points
Coach

Q. What will happen if the body of a for/in loop deletes a property that has not yet been enumerated?

  • (A) The property will be stored in a cache
  • (B) The loop will not run
  • (C) That property will not be enumerated
  • (D) All of the mentioned

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