Your First JavaScript Program

Learn how to write your first JavaScript program.

It’s a tradition when learning programming languages to start with a “Hello, World!” program. This is a simple program that outputs the phrase “Hello, World!” to announce your arrival to the world of programming.

We’re going to stick to this tradition and write a “Hello, World!” program in JavaScript. It will be a single statement that logs the phrase “Hello, World!” to the console.

The console

A console is basically a command prompt used to run code. We can enter a snippet of code, and it will be evaluated and the output logged to the screen. A console is a great way to test and experiment with code. We can get JS consoles to run in our computer terminal, as well as JS console apps for smartphones and tablets.

Okay, let’s write our first program.

Get hands-on with 1200+ tech skills courses.