Hello, World
Hello World Example in JavaScript
Here is a simple "Hello, World!" program in JavaScript:
Instructions to Run the Program
Using Node.js
Install Node.js:
Download and install Node.js from the official Node.js website.
Create the JavaScript File:
Create a new file named
helloWorld.jsand paste the above code into it.
Run the JavaScript Program:
Open a terminal and navigate to the directory where
helloWorld.jsis located.Run the program using the
nodecommand:node helloWorld.js
You should see the output:
Using Deno
Install Deno:
Download and install Deno from the official Deno website.
Create the JavaScript File:
Create a new file named
helloWorld.jsand paste the above code into it.
Run the JavaScript Program:
Open a terminal and navigate to the directory where
helloWorld.jsis located.Run the program using the
denocommand:deno run helloWorld.js
You should see the output:
Using Bun
Install Bun:
Download and install Bun from the official Bun website.
Create the JavaScript File:
Create a new file named
helloWorld.jsand paste the above code into it.
Run the JavaScript Program:
Open a terminal and navigate to the directory where
helloWorld.jsis located.Run the program using the
buncommand:bun run helloWorld.js
You should see the output: