• Using console tab of internet browsers
• Using Node.js
• By making web pages
1. Using Console Tab of Web Browsers
- Open your favorite browser (here we will use Google Chrome).
2. Open the developer tools by right tapping on an empty area and select Inspect. Shortcut: F12.
- Install the latest version of Node.js.
- Install an IDE/Text Editor like Visual Studio Code. In VS code, create a file > write JS code > save it with .js extension.
3. Open up the terminal/command prompt > navigate to the file location > type node hello.js > hit enter.
4. You will get output on the terminal.
Creating Web Pages
- Open VS Code > Go to File > New File > Save it with .html extension. For example, main.html.
- Copy this doctype (minimum valid HTML code) and save it in the file.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>worldofitech</title> </head> <body> <script src=""></script> </body> </html>
3. Similarly create a JS file, write the following JS code and save it with .js extension like main.js.
4. From inside the HTML file, we need to connect the main.js file to use it. You can accomplish that by adding the accompanying code in main.html.
5. Open the main.html file using a browser.
6. To check if our JS code ran or not, Right-click on the web page > Inspect > Choose console tab.
Thanks for reading! We hope you found this tutorial helpful and we would love to hear your feedback in the Comments section below. And show us what you’ve learned by sharing your photos and creative projects with us.