DevPath · Learn to code ESPTEN

Introduction to JavaScript

What is JavaScript?

Give your first command

Programming is giving a machine orders and watching it obey instantly. There's no magic: you write, the computer does. And you're about to see it for yourself.

Below, under "Try it yourself", is your first program. Press Run and watch what shows up in the console. (Relax: you don't need to understand every word yet. First, just feel it.)

What is JavaScript?

JavaScript (JS) was born in 1995 to bring web pages to life. Today it's one of the most widely used languages in the world and runs almost everywhere:

Why is it great to start with?

Because it's interpreted: you don't have to compile or wait for anything. You write a line, press Run, and see the result instantly. That immediate feedback is exactly what makes learning addictive.

The console: your window into the code

The tool you'll use most at the start is console.log(): it displays any value so you can see and inspect it. You've got it in action right below. 👇

Examples

Your first program — press Run

console.log("Hi! I'll do exactly what you tell me. 🤖");
console.log("Adding 1 to 100 by hand would take a while...");
console.log("For the computer:", (100 * 101) / 2, "← instantly ✨");

The console also calculates

console.log("Movie tickets:", 3);
console.log("Total to pay:", 3 * 9, "$");
console.log("Twice 21 is", 21 * 2);
Put this into practice

DevPath is a hands-on course: you read the theory here; in the app you put it into practice with exercises that really run, offline.

Start free in the app →
Basic syntax and comments →