1// 1. Using console.log()
2console.log("Hello World");
3// console.log() is used in debugging the code.
4
5// 2. Using alert()
6alert("Hello, World!");
7// // The alert() method displays an alert box over the current window with the specified message.
8
9// 3. Using document.write()
10document.write("Hello, World!");
11// // document.write() is used when you want to print the content to the HTML document.
1console.log("Hello World");
2//This is a backend process you can see when you go to the console page in inspect panel and executing the code.
3
4alert("Hello World"); //Or window.alert();
5//This will show a dialog containing Hello World.
6
7document.write("Hello World");
8//This is the common way of displaying text content in a Web page using JS.
9