Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Declaring Variables with let and const Keywords in JavaScript</title> </head> <body> <script> // Declaring variables let name = "Harry Potter"; let age = 11; let isStudent = true; // Printing variable values document.write(name + "<br>"); document.write(age + "<br>"); document.write(isStudent + "<br>"); // 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>