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.js
and paste the above code into it.
Run the JavaScript Program:
Open a terminal and navigate to the directory where
helloWorld.js
is located.Run the program using the
node
command: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.js
and paste the above code into it.
Run the JavaScript Program:
Open a terminal and navigate to the directory where
helloWorld.js
is located.Run the program using the
deno
command: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.js
and paste the above code into it.
Run the JavaScript Program:
Open a terminal and navigate to the directory where
helloWorld.js
is located.Run the program using the
bun
command:bun run helloWorld.js
You should see the output: