Menu
Coddy logo textTech

3. Longest Word

Lesson 4 of 31 in Coddy's 30 Days of Logic Building in Javascript course.

challenge icon

Challenge

Easy

Write a function that takes a sentence (string) and finds the longest word.

  • Input: <strong>"The quick brown fox jumps over the lazy dog"</strong>
  • Output: <strong>"quick"</strong>

Try it yourself

function longestWord(sentence) {
    // write your code below
    
}

All lessons in 30 Days of Logic Building in Javascript