Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Declaring Constants in JavaScript</title> </head> <body> <script> // Declaring constant const PI = 3.14; // Printing constant value document.write(PI); // 3.14 // Trying to reassign PI = 10; // error </script> <p><strong>Note:</strong> Please check out the browser console by pressing the f12 key on the keyboard.</p> </body> </html>