title: How do these two different position of return statements affect the code and why?
body: <p>Notice the different positions of the words return. How do they actually affect the output differently?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let babyNames = []
  const convertToBaby = (arr) =&gt; {
    for (let i = 0; i &lt; arr.length; i += 1) {
      babyNames.push('baby ' + arr[i])
    }
    return babyNames
  }
  
  const animals = ['panda', 'turtle', 'giraffe', 'hippo', 'sloth', 'human'];
  console.log(convertToBaby(animals))</code></pre>
  </div>
  </div>
  </p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let babyNames = []
  const convertToBaby = (arr) =&gt; {
    for (let i = 0; i &lt; arr.length; i += 1) {
      babyNames.push('baby ' + arr[i])
      return babyNames
    }
  }
  
  const animals = ['panda', 'turtle', 'giraffe', 'hippo', 'sloth', 'human'];
  console.log(convertToBaby(animals))</code></pre>
  </div>
  </div>
  </p>