Last active
September 12, 2020 16:17
-
-
Save DATADEER/f1faa6e612b8f8f4e391c509e741774a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# parses and sums up durations of each episode from the designacademy.io course | |
# paste into console on https://www.designacademy.io/lesson/welcome-to-the-course/ | |
Array.from(document.querySelectorAll('.note')) | |
.map((elem) => elem.innerText) | |
.map((text) => text.split('|')[1]) | |
.filter((exists)=>exists) | |
.map((text)=> text.trim().split(':') | |
.map((number) => parseInt(number)) | |
.reduce((acc,curr,i)=>i===0 ? acc + (curr * 60): acc + curr ,0)) | |
.reduce((acc,curr)=>acc+curr,0 )/60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment