Why does console.log work but not return?
<p>I'm working on this Kata:
Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (Just like the name of this Kata). Strings passed in will consist of only letters and spaces. Spaces will be included only when more than one word is present.</p>

<p>This isn't the most beautiful code but how come console.log prints the expected result and the return commands (which I've commented out) do not work?</p>

<pre><code>function spinWords(sentence){

  function reverse(s) {
    return s.split('').reverse().join('');
  }

  var words = sentence.split(" ");

  for (var i=0; i&lt;words.length; i++){
    var word = words[i].toString();
    var backwards = reverse(word);

    if (word.length&gt;=5){
      console.log(backwards);
      //return backwards;
    } else {
      console.log(word);
      //return word;
    }
  }
}
</code></pre>