title: Return partial sums of the array items as an array
body: <p>I am trying to solve <a href="https://www.codewars.com/kata/5ce399e0047a45001c853c2b/train/javascript" rel="nofollow noreferrer">this</a> kata on Codewars using JavaScript.</p>
  
  <p>(sorry that I haven't copied and pasted the exercise here, the explanation is quite long)</p>
  
  <p>I have some code that works for smaller arrays, but it is returning a server timeout error when I try to submit the solution:</p>
  
  <pre><code>function partsSums(ls) {
    const results = [];
    ls.forEach((c, i) =&gt; {results.push((ls.slice([i])).reduce((a, b) =&gt; {return(a+b)}))});
    results.push(0);
    return results;
  };
  </code></pre>
  
  <p>I don't know how to make this code any more efficient so that I can submit the solution. Any help on this would be appreciated!</p>