A
Q. What will happen if we execute the following piece of code?
Code:<script>
var arr=[4,3,,1];
for(i=0;i<4;i++){
document.writeln(arr[i]);
}
</script>
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 QuestionA
<script>
var arr=[4,3,,1];
for(i=0;i<4;i++){
document.writeln(arr[i]);
}
</script>
A
<script>
function myFunction() {
var i;
for (i = 0; i< 5; i++) {
if (i === 3) {
continue;
}
document.write(i);
}
}
myFunction();
</script>
A
<script> var string1=[1,2,3]; var string2=[4,5,6,7,8,9,10]; var result=string1.concat(string2); document.writeln(result); </script>
A
A
A
A
A
A
A
<script>
functionprintprops(o)
{
for(var ain o)
console.log(a+": "+ o[a]+"
");
}
</script>
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