Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Single Line Comments in JavaScript</title> </head> <body> <script> function helloWorld(){ alert("Hello World!"); // alert "Hello World!" in the browser } window.onload = helloWorld(); </script> </body> </html>