How Long Is a Word?
Count the letters with length.
How Long Is a Word? is a free Javascript for Kids lesson on CoddyKit. This is lesson 3 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, and your progress syncs across the web and the CoddyKit app. The Javascript for Kids course includes 4 lessons in total.
How Long is a Word? 📏
Hello, measuring master! 🌟 Today we count how many letters are in a word.
We use a magic helper called .length! 🔢
console.log("cat".length)The .length Helper 🪄
Add .length after a string and it counts the letters!
"cat".length is 3 because c-a-t is 3 letters. 🐱
console.log("dog".length)Counting a Big Word 🐘
Long words have a big length!
Let us count the letters in "elephant". 🐘
console.log("elephant".length)Spaces Count Too ␣
Remember, spaces are part of the string!
So "a b" has a length of 3: a, space, b. 👀
console.log("a b".length)Measuring a Box 📦
You can measure a string saved in a box too!
Put a word in a box, then check its .length. 📐
let word = "rainbow"
console.log(word.length)Empty String Length 🫙
An empty string "" has a length of 0.
No letters means zero! 0️⃣
console.log("".length)Whose Name is Longer? 🧒
We can compare lengths to see whose name is longer!
Let us check two names. 🆚
console.log("Sam".length)
console.log("Olivia".length)Length of a Sentence 📜
A whole sentence has a length too! It counts every letter AND every space.
That can be a big number! 🤯
console.log("I love cake".length)Using Length in a Message 💬
We can join .length with words to make a fun message!
Tell everyone how long a word is. 📣
let animal = "tiger"
console.log("Tiger has " + animal.length + " letters")Count Your Name ✍️
Change "Alex" to YOUR name and see how long it is!
So cool to measure your own name. 😍
let myName = "Alex"
console.log("My name has " + myName.length + " letters")Emojis and Length 🦄
Even emojis add to the length! Try counting a word with a smiley.
Every character counts! 🎈
console.log("hi 😀".length)Quick Check ✅
Question time! Take your time and think. 🧠
Measuring Champion! 🏆
Brilliant! 🎊 Today you learned:
.lengthcounts the letters in a string- Spaces and emojis count too!
- An empty string has length 0
You are a length-measuring legend! 📏⭐
console.log("I can measure words! 📏")Learn JavaScript with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 35
- Lessons
- 140
Frequently Asked Questions
Is the “How Long Is a Word?” lesson free?
Yes — the full text of “How Long Is a Word?” is free to read here on the web. 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. The Javascript for Kids course includes 4 lessons in total.
What will I learn in “How Long Is a Word?”?
Count the letters with length. 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, so you can start here or from the beginning and move at your own pace. This is lesson 3 of 4.
How long does the “How Long Is a Word?” 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.
All lessons in this course
- What Is a String?
- Joining Words Together
- How Long Is a Word?
- Making Words SHOUT or whisper