title: Counting in jquery Array
body: <p>I seem to have trouble calculating some numbers together. When I want to use:</p>
  
  <pre class="lang-js prettyprint-override"><code>for (var key in week_total) {
      $("." + key).html(week_total[key]);
  }
  </code></pre>
  
  <p>I am getting a <code>NaN</code> and thereforce every group has a <code>NaN</code>. Is this the right way of even using <code>week_total[group] = week_total[group] + work_minutes;</code>?</p>
  
  <p>My script:</p>
  
  <pre class="lang-js prettyprint-override"><code>drawCallback: function (settings) {
      var api   = this.api(), data;
      var rows  = api.rows({page: 'current'}).nodes();
      var last  = null;
  
      var week_total = new Array;
  
      api.column(weekColumn, { page: 'current' }).data().each(function (group, i) {
          var work_hours   = api.column(hourColumn).data()[i].split(':');
          var work_minutes = (+ work_hours[0]) * 60 + (+ work_hours[1]);
  
          week_total[group] = week_total[group] + work_minutes;
  
          if (last !== group) {
              $(rows).eq(i).before('&lt;tr&gt;&lt;td colspan="5"&gt;{{ trans('admin.worktime.field.week') }} ' + group + '&lt;/td&gt;&lt;td colspan="3" style="font-style:italic;" class="' + group + '"&gt;&lt;/td&gt;&lt;/tr&gt;');
  
              last = group;
          }
      });
  
      for (var key in week_total) {
          $("." + key).html(week_total[key]);
      }
  
      var array = {
          work_month: work_month,
          work_year: work_year
      };
  
      history.pushState(null, null, '?' + $.param(array));
  
      drawDataTable(this);
  }
  </code></pre>