Function to convert strings from hmmss, mmss, ss format to milliseconds Here's the current logic to convert strings in the format hh:mm:ss, mm:ss or ss to milliseconds.

Any comments on how to improve this? 

hhmmssToMillis(hhmmss) {
   let time= hhmmss.split(':').reverse();
   let millis = 0;
   switch(time.length) {
     case 1: 
         millis = parseInt(time[0]) * 1000;
         break;
     case 2: 
         millis = (parseInt(time[1]) * 60 + parseInt(time[0])) * 1000;
         break;
     case 3: 
         millis = (parseInt(time[2]) * 60 * 60 + parseInt(time[1]) * 60 + parseInt(time[0])) * 1000;
         break;
   } 
   return millis; 
}
Use const instead of let if the variable is not being reassigned.

You can do away with the millis variable if you return early throughout the switch statement. This also allows you to remove the break statements.

hhmmssToMillis(hhmmss) {
    const time = hhmmss.split(':').reverse();
    switch(time.length) {
       case 1: 
         return parseInt(time[0]) * 1000;
       case 2: 
         return (parseInt(time[1]) * 60 + parseInt(time[0])) * 1000;
       case 3: 
         return (parseInt(time[2]) * 60 * 60 + parseInt(time[1]) * 60 + parseInt(time[0])) * 1000;
    }
    return 0; 
}