title: Find sum of time in an array of time format hh:mm:ss
body: <p>I have this code that works to find the sum properly for format hh:mm
  I am having hard time converting this to format hh:mm:ss
  Obviously everything should be rounded up correctly.</p>
  
  <p>this is the format of the array i am looking for to work with but code obviously works only for ["00", "10"] as an example</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>const array = [
    ["00", "00", "09"],
    ["00", "00", "09"],
    ["00", "00", "04"],
    ["00", "00", "02"],
    ["00", "00", "21"],
    ["00", "00", "14"],
    ["00", "00", "26"],
    ["00", "00", "02"],
    ["00", "00", "14"],
    ["00", "00", "10"],
    ["00", "00", "48"],
    ["00", "00", "12"],
    ["00", "00", "09"],
    ["00", "00", "09"]
  ]
  
  var mins = 0;
  var hrs = 0;
  
  if (array == null) {
    mins = Number(t1[1]) + Number(t2[1]);
    hrs = Math.floor(parseInt(mins / 60));
    hrs = Number(t1[0]) + Number(t2[0]) + hrs;
  } else {
    $.each(array, function(key) {
      mins += Number(array[key][1]);
      hrs = Math.floor(parseInt(mins / 60));
      hrs += Number(array[key][0]) + hrs;
    });
  }
  
  console.log(mins, hrs)</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><code>t1</code> and <code>t2</code> in this case are just 2 separate values to be added together then there is an array of bunch of these. Both should work right.</p>
  
  <p>please help me add properly seconds in here too.</p>