Skip to content
Lesson 1 of 9 Free Preview
Duration: 15 min

Hello, JavaScript

Learn it

JavaScript runs in every web browser. Open the console (F12 or right-click β†’ Inspect β†’ Console) to try code, or use CodePen/JSFiddle. console.log() prints messages.

🧰 Tool: a free online editor such as CodePen or JSFiddle, or a plain text editor and your web browser.

Code examples

JavaScript

console.log("Hello, world!");
console.log(6 * 7);
let name = "Riley";
console.log("Hi " + name);
console.log(`Template strings: ${name} has ${name.length} letters`);

Backticks make template strings with ${…}.

Project: Console explorer

  1. Open the browser console.
  2. Run each line.
  3. Use console.log to print your name, age next year, and a fun fact.

Challenge: Try alert(“Hi!”) β€” it shows a popup.

Enjoying this lesson?

Enroll in the full course to access all lessons, track your progress, and earn a certificate.

Enroll in Full Course