First JavaScript Program

Learn to create and execute the first JavaScript program.

Problem solving with JavaScript

The basic tools for understanding the flow and the results of simple programs are execution sheetsThe execution sheet is a manual way of observing and updating the values of the variables at each step of the execution of a program. and flowchartsThe flowchart is a diagram that helps understand the sequence of instructions in a program having decision.. However, they become complicated when we have problems with a large number of decisions. Therefore, we provide executable embedded code widgets to observe the program output by executing it.

Note: We can run a program as many times as we want, to try out different inputs of variables. We can also edit these programs to observe the result of a change in a value or logic for our learning.

In JavaScript, we use prompt() for input (to read a value from the user), and console.log() for print (to display a value on the screen as output).

Hello World

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

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy