0Pricing
Javascript for Kids · Lesson

How Long Is a Word?

Count the letters with length.

How Long Is a Word? is a free Javascript for Kids lesson on CoddyKit — 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, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

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:

  • .length counts 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! 📏")

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, 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 “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; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

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

  1. What Is a String?
  2. Joining Words Together
  3. How Long Is a Word?
  4. Making Words SHOUT or whisper
← Back to Javascript for Kids