Home »
MCQs »
JavaScript MCQs
What will be the value of VALUE?
24. What will be the value of VALUE?
<script>
const VALUE = 10;
VALUE = 20;
</script>
- 10
- 20
- ValueError
- 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"