Follow us on Facebook
Faucibus toroot menuts
Let's check few of the above mentioned points below:
document.getElementById("result").innerHTML = x;
Now if we try to declare the constant again with the same name then it will throw an error.
const x = 100;Const keyword
On the contrary of this if you want to keep the value the same, and do not want to overwrite then the keyword const is used for that.
<h2>The value of const is : </h2>
//const x = 2;
const x = 100;
Const x =200;
You will see this error
const.html:14 Uncaught SyntaxError: Identifier 'x' has already been declared