Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

Your First Program · Lesson 6 of 15

Hello World

A free lesson from Swipe Coding · JavaScript, level 2 · updated October 2026

By the Swipe team, founded by Colin · how we make lessons

🤖
Every programmer's journey starts here — even mine, technically. 🤖

By tradition, the very first program you write in a new language simply prints "Hello, World!" — a small way to confirm everything is set up and working before you move on to anything more complicated. In JavaScript, that program is a single line.

console.log("Hello, World!");
This one line prints Hello, World! to the console — traditionally the first program written in any language.

You can run this two different ways. Open a browser's Developer Tools, click the Console tab, type the line in, and press Enter to see it run instantly. Or, save it inside a .js file and link it into an HTML page with a <script> tag (or run it with Node.js) so it executes automatically when the page loads.

🤖
Quotes aren't decoration here — they're what makes text text. 📖

Notice that "Hello, World!" is wrapped in quotation marks. In JavaScript, text like this is called a string, and it must be wrapped in matching quotes — either single (') or double (") — so the engine knows where the text begins and ends.

Fill in the blank

In JavaScript, text values like "Hello, World!" must be wrapped in matching ____ marks.

Quick check

What will console.log("Hello, World!") print?

True or false

You can only run a Hello World program by saving it in a file — typing it directly into the browser console doesn't work.

Try changing the message inside the quotes and running it again — Hello World is meant to be experimented with, not just typed once and forgotten.

Keep your streak going in Swipe Coding

Swipe through every level of JavaScript on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.

Get the Swipe apps →