0Pricing
Javascript for Kids · Lesson

Counting Words

Count the pieces.

Let's Count Words! 🔢

Welcome back, word wizard! 📝 Last time we split sentences into word pieces. ✂️

Today we will count how many words there are! 🔢 Ready? Let's go!

Back to Splitting ✂️

First, let's split a sentence again to get our list of words. 📋

Remember, split(' ') gives us an array! 🪄

let sentence = 'I love my dog';
let words = sentence.split(' ');
console.log(words);

All lessons in this course

  1. Splitting Text
  2. Counting Words
  3. Counting Letters
  4. Longest Word
← Back to Javascript for Kids