Sum an array of video lengths in JavaScript into HH:MM:SS
The global hours, minutes, seconds are icky. Many of the functions you've defined access and change them, in essence causing side-effects.

Besides, this seems over-engineered. The sumArrayIndex function is a strange mix of specific and generic. It's specific because it expects an array of strings with a delimiter and stuff that can parsed to integers and summed. But it's generic in that it stops there. It's already built for this very specific task, but doesn't go all the way. Instead you have to call it twice (and it has to split everything twice, etc.).

You have 3 tasks here:


convert each time code to the smallest common unit (i.e. seconds),
calculate the total,
format it as HH:MM:SS.


Your sumArrayIndex does some of the first two, rather than just one of them, or all of both.

Also having a function like minToSec is a little much. It's literally just a multiplication. In this context, I'd say that 60 doesn't even count as a magic number. So no reason to wrap it in a function; just multiply.

There also some bugginess: Should the final total be, say, 2:00:01, your code will output "2:0:1" because it doesn't pad the numbers.

And lastly, you're parsing seconds as a base16 number in tallyTime? I don't know why you're using parseInt on something that's already an int, and I certainly don't know why you're expecting it to be base16.

Anyway, here's my (very different) take:

function sumDurations(durations) {
  return durations.reduce((sum, string) =&gt; {
    var mins, secs;
    [mins, secs] = string.split(":").slice(-2).map(n =&gt; parseInt(n, 10));
    return sum + mins * 60 + secs;
  }, 0);
}

function formatDuration(duration) {
  function pad(number) {
    return `${number}`.slice(-2);
  }

  let hours = duration / 3600 | 0;
  let minutes = duration % 3600 / 60 | 0;
  let seconds = duration % 60;
  let minsSecs = `${pad(minutes)}:${pad(seconds)}`;

  return hours &gt; 0 ? `${hours}:${minsSecs}` : minsSecs;
}


Some notes:


It's two functions for the sake of clarity, though they could be combined or be placed inside an outer function to hide that implementation detail (like pad is nested inside formatDuration).
I've combined steps 1 &amp; 2 in sumDurations.
I'm using some array destructuring to pull out the minutes and seconds after splitting the time code string.
Like your code, you'll get wrong results if the time code contains hours as well. Mine ignores them, yours treats them as minutes - and the minutes as seconds. Fixing this is an exercise left to the reader.
I'm using the | 0 trick, which does the same as Math.floor (for positive numbers that fit in 32-bit integers anyway).
I'm using ES6 string templates/interpolation to build the final string.