title: How to fix TypeError: Cannot read property 'length' of undefined in JavaScript?
body: <p>I am trying to solve a very easy challenge about finding the longest word in a string. 
  This is the code: </p>
  
  <pre><code>function find(par) {
      let arrayWord = par.split(" ");
      let longestWord = "";
      for (let i = 0; i &lt;= arrayWord.length; i++) {
          if (longestWord.length &lt; arrayWord[i].length) {
              longestWord = arrayWord[i]
          }
      }
      return longestWord;
  }
  find("Find the longest word");
  </code></pre>
  
  <p>I would need help understanding why I am getting this error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'length' of undefined
        at find (:5:47)
        at :11:1 find @ VM959:5 (anonymous) @ VM959:11</p>
  </blockquote>
  
  <p>thank you.</p>