Q. What will be the output of the following JavaScript code?

Code:
<script>
    const myArray = ['h', 'e', 'l', 'l', 'o'];
    document.write(myArray[0]);
    document.write(myArray[1]);
</script>
  • (A) he
  • (B) undefinedh
  • (C) ValueError
  • (D) TypeError
πŸ’¬ Discuss
βœ… Correct Answer: (A) he

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
240
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
98%
Success Rate