str.split is not a function error in javascript
<p>I keep getting an error when I input the following into Sublime: </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function longestWord(str) {
  var result = str[0];
  str = str.split(' ');

  for (var i = 0; i &lt; str.length; i++) {
    if (str[i].length &gt; result.length) {
      result = str[i];
    }
  }
  return result;
}

var sentence = ["the quick brown fox jumped over the lazy dog."];

console.log(longestWord(sentence));</code></pre>
</div>
</div>
</p>

<p>I get an Uncaught TypeError: str.split is not a function(...)</p>

<p>What am I doing wrong?  Thank you!  </p>