Strings and Formatting
LockedLesson 3 of 25 · Syntax · Easy
Finish these first:Variables and Primitive Types →Or pass the tests below to unlock it now.
The big idea
A string is how JavaScript stores text — names, words, or messages. Wrap your text in double quotes "..." or single quotes '...': Strings are case-sensitive ("Hello" and "hello" are different).
Think of it like this: Think of a string like letters written on a sticky note — the quotes tell JavaScript where the text begins and ends.
Read the lesson
A string is how JavaScript stores text — names, words, or messages.
Wrap your text in double quotes "..." or single quotes '...':
let city = "Tokyo";
let pet = 'Milo';
let note = "Welcome!";
Strings are case-sensitive ("Hello" and "hello" are different). You can join strings with + or check how many characters a string has using .length.
Quick check
Which line stores text inside a JavaScript variable named city?
Your challenge
Create a variable named greeting storing the text "Hello" (type let greeting = "Hello";).
More learning tools(compare languages, visual guide, related lessons)
Compare with another language
Similar to python.strings (86% overlap). UTF-8 string manipulation: template literals in JS, std::string in C++, immutable strings in Go, &str/String in Rust.
Visual walkthrough
A diagram, a step-by-step animation, and short captions for Strings and Formatting.
Learn this first
Opens up next
This is the last lesson in this branch.