Q. Which one of the following options is the correct output for the given code of JavaScript?
Code:var arr=[4,3,2,1]; var rev=arr.reverse(); document.writeln(rev);
Dear candidates you will find MCQ questions of JavaScript here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
var arr=[4,3,2,1]; var rev=arr.reverse(); document.writeln(rev);
var values=[4,5,6,7] varans=values.slice(1); document.writeln(ans);
var x1 =[,,,]; var x2 =newArray(10); 0in x1 0in x2
<script>
var arr=[4,3,,1];
for(i=0;i<4;i++){
document.writeln(arr[i]);
}
</script>
<script>
function myFunction() {
var i;
for (i = 0; i< 5; i++) {
if (i === 3) {
continue;
}
document.write(i);
}
}
myFunction();
</script>