What will be the value of VALUE?

24. What will be the value of VALUE?

<script>
	const VALUE = 10;
	VALUE = 20;
</script>
  1. 10
  2. 20
  3. ValueError
  4. TypeError

Answer: D) TypeError

Explanation:

We cannot change the value of a constant, thus the above code will generate a TypeError – "TypeError: Assignment to constant variable"

Comments and Discussions!

Load comments ↻






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