Explore topic-wise MCQs in Javascript.

This section includes 2 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.
for(var n in m)
console.log(m[n]);

The above code is equivalent to which code?

A. None of these
Answer» C.
2.

Consider the following code snippet.

A. <pre class="prettyprint lang-c">for (var i = 1;i &lt; a.length;i++)<br> console.log(a[i]);<br></pre>
B. <pre class="prettyprint lang-c">for (var i = 0;i &lt; a.length;i++)<br> console.log(a[i]);<br></pre>
C. <pre class="prettyprint lang-c">for (int i = 0;i &lt; a.length;i++)<br> console.log(a[i]);<br></pre>
D. <pre class="prettyprint lang-c">for (var i = 0;i &lt;= a.length;i++)<br> console.log(a[i]);<br></pre>
E. None of these
Answer» C. <pre class="prettyprint lang-c">for (int i = 0;i &lt; a.length;i++)<br> console.log(a[i]);<br></pre>