JSFiddle - React, Tailwind, and code Playground
by darcyclarke
JavaScript
var durations = ["12:38", "6:36", "9:03", "8:34", "5:02", "6:54", "13:22", "4:41", "8:36", "21:58", "3:06", "10:46", "10:13", "12:54", "14:00", "11:03", "16:03", "10:52", "24:53", "10:03", "11:49", "15:47", "3:19", "2:06", "5:47", "1:03", "5:29", "5:47", "26:39"];
// write a function that will take the above array of string durations and convert it hours/mins/seconds
// You can use any JS you want - loops/map/reduce/etc...
durations.map( function ( dur ) {
dur = dur.split( ':' );
return { hours: ( dur[ 0 ] % 60 | 0 ), mins: ( dur[ 0 ] % 60 | 0 ), }
});