[javascript] Convert HH:MM:SS string to seconds only in javascript

Here is maybe a bit more readable form on the original approved answer.

const getSeconds = (hms: string) : number => {
  const [hours, minutes, seconds] = hms.split(':');
  return (+hours) * 60 * 60 + (+minutes) * 60 + (+seconds);
};