title: How is maxLength able to find the longest word in the string?
body: <p>Can anybody explain how maxLength is working in this section of code. How is it being used to find the longest word in the string?</p>
  
  <pre><code>function findLongestWord(str) {
    var words = str.split(' ');
    var maxLength = 0;
  
    for (var i = 0; i &lt; words.length; i++) {
      if (words[i].length &gt; maxLength) {
        maxLength = words[i].length;
      }
    }
  
    return maxLength;
  }
  
  findLongestWord("housework is easy when you're happy");
  </code></pre>