Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Writing into the Browser's Console with JavaScript</title> </head> <body> <script> // Printing a simple text message console.log("Hello World!"); // Prints: Hello World! // Printing a variable value let x = 10; let y = 20; let sum = x + y; console.log(sum); // Prints: 30 </script> <p><strong>Note:</strong> Please check out the browser console by pressing the f12 key on the keyboard.</p> </body> </html>