πŸ“Š JavaScript
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>  
  • (A) The output will be 4 3 1
  • (B) The output will be 4 3 undefined 1
  • (C) It will result in an error
  • (D) It does not run at all
πŸ’¬ Discuss
βœ… Correct Answer: (B) The output will be 4 3 undefined 1

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
223
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yashika
Publisher
πŸ“ˆ
95%
Success Rate