JavaScript Constant

The Constant variable refer to those variable whose value does not changes during program run and their values are fixed and cannot be modified by program. In JavaScript const statement is used to create constant variable. Syntax :
  const constant_name = value;
Example :
<html>
<head>
  <title>JavaScript Constant</title>
</head>
<body>
  <script type="text/javascript">
    const x = 10;
    document.write("Constant Variable : ", x);
  </script>
</body>
</html>
Output :

Constant Variable : 10


Next Topic :