...

Web Technologies - JAVASCRIPT

Back to Course

Lesson Description


Lession - #203 Javascript Const


const

Constants are block-scoped, similar as variables declared utilizing the let keyword. The value of a const can't be changed through reassignment (for example by utilizing the assignment opeartor>
, and it can't be redeclared (for example through a variable declaration>
.

Let's see an example


<!DOCTYPE html>
<html>
<body>

<script>
     const x = 16;
     document.write("The value of const variable x = " + x>
; </script> </body> </html>

Output


Try it here