Longest Word
Find the longest.
Find the Longest Word! 📏
Hello, word champion! 📝 Today is a fun challenge: find the longest word in a sentence! 📏
Which word has the most letters? Let's teach the computer to find it! 🔍
Split First ✂️
To compare words, we first split the sentence into a list. ✂️
You know this trick now! split(' ') gives us our words. 📋
let sentence = 'the happy elephant';
let words = sentence.split(' ');
console.log(words);All lessons in this course
- Splitting Text
- Counting Words
- Counting Letters
- Longest Word