title: Why isn't this function returning a value?
body: <pre class="lang-js prettyprint-override"><code>GetNextdaySchoolMeal():Array&lt;string&gt;{
      fetch(this.GetLink())
        .then((response) =&gt; {
          return(response.json());
        })
        .then((response) =&gt; {
          return(response.mealServiceDietInfo[1].row[0].DDISH_NM.split(&quot;&lt;br/&gt;&quot;));
        })
        .catch(function(error){throw new Error(error);});
    }
  </code></pre>
  <pre><code>error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
  </code></pre>
  <p><code>this.GetLink()</code> returns the API link for the next weekday. Why can't the <code>response.mealServiceDietInfo[1].row[0].DDISH_NM.split(&quot;&lt;br/&gt;&quot;)</code> in the second <code>then</code> callback be returned from <code>GetNextdaySchoolmeal</code>?</p>
  <p>If I put <code>console.log</code> instead of return in the seventh line and delete the type in the first line, it will work as expected. However, I expect that the function returns an array.</p>