Skip to main content
🟨 JavaScript Foundations

Variables & Values

A variable is a named box that holds a value. In modern JavaScript you create one with const (for values that don't change) or let (for values that do).

const name = "Boots";
let level = 1;
level = 2; // ok, because it's "let"

Your task

Declare a variable called greeting and set it to the string "hello world".

⚑ 20 XP

🧱 Code blocks

Drag a block into the editor, or tap it to drop it in where your cursor is. Add them in order to build your answer.

solution.jsRuns in your browser
Loading editor…
Tests2 to pass
greeting is defined
greeting equals "hello world"

Run your code to check these.