title: javascript reduce gets undefined
body: <p>I am getting undefined. The code works without the function. What am I doing wrong?</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>var myArr = [ 1, 2, 3, 4, 5 ];
  
  function getSums(arr) {
    arr.reduce(a =&gt; a+1, 0);
  }
  
  document.write(getSums(myArr));</code></pre>
  </div>
  </div>
  </p>