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>
  1. 10
  2. 0
  3. SyntaxError
  4. TypeError

Answer: C) SyntaxError

Explanation:

The output of the above JavaScript code is: "SyntaxError: 'a' has already been declared".

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.