If you are complete beginner to Javascript just started learning today want to write your first Javascript hello world program then I will show you how to write hello world program in javascript and what is the correct javascript syntac to write hello world.
This tutorial is completely for beginners who want to write their first javascript hello world program so let’s write javascript hello world program.
What is the correct javascript syntax to write hello world?
The correct javascript syntax to write hello world program is using the “document.write(‘Hello World’);”. This line of code will print Hello world on the web page.
Output:
![Javascript hello world program](https://coderzway.com/wp-content/uploads/2021/08/Screenshot-224-e1629451305149.png)
Congratulations on writing your first javascript hello world program now let’s see how to write hello world program in javascript console.
If you want to test this code now without any software installation then you can check our HTML, CSS and Javascript compiler.
How to write hello world in javascript console?
You can also print hello world in your javascript console or terminal by using “console.log(‘Hello World’);” function this will print hello world in your terminal.
Output:
You can test this code now by opening inspect tool in your chrome browser and go to the console tab and paste the code. It is mostly used for debugging in javascript.
Here are some more guides you can read:
- Alphanumeric validation in javascript.
- Mobile number validation in javascript.
- How to hack chrome dinosaur game in javascript.
I hope you found what you were looking for and found this guide helpful if you want more guides like this then subscribe to our Telegram channel – Join the Coderzway Telegram channel.
Thank you for reading, Have a nice day 🙂