title: javascript array turns to be undefined
body: <p>Input: <code>nums = [1,2,3,4]</code>
  Output: <code>[1,3,6,10]</code>
  Explanation: Running sum is obtained as follows: <code>[1, 1+2, 1+2+3, 1+2+3+4]</code>.</p>
  <pre><code>var runningSum = function(nums) {
      const array = new Array (nums.length);
      array[0] = nums[0];
      for( let i=1; i&lt;nums.length; i++){
          array[i] = nums[i] + array[i-1]
      }
  };
  </code></pre>
  <p>the result turns out to be undefine, I don't know where I did wrong.</p>