Articles → JAVASCRIPT → const keywords in JavaScript

const keywords in JavaScript






Purpose









Example




<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="utf-8" />
      <title></title>
      <script>
         const pi = 3.14;
         
         // This code will give error
         pi = 3.1416;
         
         const pi2;
         
         // This code will give error
         pi2 = 3.1416;
      </script>
   </head>
   <body>
   </body>
</html>





Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, July 28, 2021

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250