What Is a String?
Strings are pieces of text in quotes.
What Is a String? is a free Javascript for Kids lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Javascript for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Hello, Words! 👋
Hi there, young coder! 🌟 Today we learn about strings.
A string is just text that the computer can read. Like your name, a magic word, or "Hello!" 🎉
console.log("Hello!")Quotes are Magic Bags 🎒
To make a string, we wrap our text in quotes. Quotes are like little bags that hold your words!
Look: "cat" is a string. The cat is safe inside the quotes! 🐱
console.log("cat")Say Your Name 🧒
Let us put YOUR name in a string. Try changing "Sam" to your own name!
The computer will say it back to you. 🗣️
console.log("My name is Sam")Numbers Can Be Strings Too 🔢
Even numbers can hide in quotes! "123" is a string of text, not a math number.
If it has quotes, it is a string. Easy! 😄
console.log("123 is a string")Single or Double Quotes 👯
You can use double quotes "like this" OR single quotes 'like this'.
Both make strings! Pick your favorite. 🎈
console.log('I love single quotes')Saving a Word in a Box 📦
We can save a string in a box with a name. We call this box a variable.
Here we put "treasure" in a box called word. 💎
let word = "treasure"
console.log(word)Strings Can Be Long 📜
A string can be one word OR a whole sentence!
"I have a pet dragon that loves cookies" is one big string. 🐉🍪
console.log("I have a pet dragon that loves cookies")Empty String 🫙
A string with nothing inside is an empty string. It looks like this: ""
It is like an empty bag. Still a bag, just no words yet! 🛍️
let nothing = ""
console.log("This is empty:", nothing)Spaces Count! ␣
Spaces inside quotes are part of the string too!
"hi" and "hi " are a little different. The second one has a space at the end. 👀
console.log("space matters")Strings With Emojis 🦄
You can even put emojis in your strings! They are part of the text too.
How fun is that? 🌈🦄🍭
console.log("I love coding 🦄🌈")You Made a String! 🎉
Wow! You now know what a string is. Let us make a happy message string together!
Change the words and make it YOURS. 💖
let happy = "Coding is fun!"
console.log(happy)Quick Check ✅
Time for a fun question! You can do it! 🌟
Yay, You Did It! 🏆
Awesome work! 🎊 Today you learned:
- A string is text in quotes
- Use
" "or' ' - You can save strings in boxes called variables
You are a string superstar! ⭐
console.log("I learned about strings! 🌟")Frequently asked questions
Is the “What Is a String?” lesson free?
Yes — the full text of “What Is a String?” is free to read here on the web, and the Javascript for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Javascript for Kids course, upgrade to CoddyKit PRO.
What will I learn in “What Is a String?”?
Strings are pieces of text in quotes. You practise Javascript for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Javascript for Kids?
No prior experience is required. Javascript for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “What Is a String?” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Javascript for Kids lesson?
Yes. Every Javascript for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.