Home »
MCQs »
JavaScript MCQs
What is the output of the following JavaScript code (let example)?
31. What is the output of the following JavaScript code (let example)?
<script>
let a = 10;
let a = 0;
</script>
- 10
- 0
- SyntaxError
- TypeError
Answer: C) SyntaxError
Explanation:
The output of the above JavaScript code is: "SyntaxError: 'a' has already been declared".