Explore topic-wise MCQs in Javascript.

This section includes 13 Mcqs, each offering curated multiple-choice questions to sharpen your Javascript knowledge and support exam preparation. Choose a topic below to get started.

1.

Consider the following code snippet. What does the last statement return ?

A. 9
B. 0
C. 10
D. None of the mentioned
Answer» D. None of the mentioned
2.

Consider the following code snippet. What is the function of the code snippet?

A. Returns value null
B. Returns exception
C. Returns the value in scope
D. None of the mentioned
Answer» D. None of the mentioned
3.

Consider the following code snippet. What will the code snippet result ?

A. Prints the contents of each property of o
B. Returns undefined
C. All of the mentioned
D. None of the mentioned
Answer» C. All of the mentioned
4.

Consider the following code snippet. What does the below code result?

A. Sum of square of a and b
B. Square of sum of a and b
C. Sum of a and b square
D. None of the mentioned
Answer» B. Square of sum of a and b
5.

Consider the following code snippet. The state stored in d is :

A. 1
B. 0
C. Null
D. Undefined
Answer» B. 0
6.

Consider the following code snippet :var grand_Total=eval("10*10+5");The output for the above statement would be :

A. 10*10+5
B. 105 as a string
C. 105 as an integer value
D. Exception is thrown
Answer» D. Exception is thrown
7.

Consider the following code snippet :var string2Num=parseInt("123xyz");The result for the above code snippet would be :

A. 123
B. 123xyz
C. Exception
D.
Answer» C. Exception
8.

For the below mentioned code snippet:var o = new Object();The equivalent statement is:

A. var o = Object();
B. var o;
C. var o= new Object;
D. Object o=new Object();
Answer» D. Object o=new Object();
9.

Consider the following code snippet :var tensquared = (function(x) {return x*x;}(10));Will the above code work ?

A. Yes, perfectly
B. Error
C. Exception will be thrown
D. Memory leak
Answer» B. Error
10.

Consider the following code snippet :if (!a[i]) continue ;What is the observation made ?

A. Skips the undefined elements
B. Skips the non existent elements
C. Skips the null elements
D. All of the mentioned
Answer» E.
11.

Consider the following code snippet. The final output for the shift() is

A. 1
B. [4,5]
C. [3,4,5]
D. Exception is thrown
Answer» B. [4,5]
12.

Consider the following code snippet. The result would be

A. true false
B. false true
C. true true
D. false true
Answer» B. false true
13.

Consider the code snippet given below:var count = [1,,3];What is the observation made?

A. The omitted value takes "undefined"
B. This results in an error
C. This results in an exception
D. None of the mentioned
Answer» B. This results in an error