...

/

First JavaScript Program

First JavaScript Program

Learn to create and execute the first JavaScript program.

Hello World

It’s time to write our first program in JavaScript, which will display or log the message "Hello World!" on the console.

We’ll use the following widget to write our JavaScript code. We can execute our JavaScript program by clicking the “Run” button at the bottom of the widget.

In JavaScript, we use console.log() for print (to display a value on the screen as output).

Run the code below to see the output. For a better understanding, you can take the AI mentor’s help.

Javascript (babel-node-es2024)
console.log("Hello World!"); // display/log Hello World on console

Note: We can add non-executable text in a JavaScript program by adding the // sign at the start of the text. This type of text is called a comment. We use comments to include descriptions in the program. ...