Skip to content

Instantly share code, notes, and snippets.

@Thiruppathi
Thiruppathi / Calculate Duration.md
Created January 2, 2020 11:18
Calculate Duration for courses
const 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"];


function sumDurations(durations) {
  return durations.reduce((sum, string) => {
    var mins, secs;
 [mins, secs] = string.split(":").slice(-2).map(n => parseInt(n, 10));
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',