Created
June 14, 2020 12:19
-
-
Save YounglanHong/73f1d193c2b49cfe0b6b88010d36f07f 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
//2️⃣ Reduce | |
const seconds = timeNodes | |
.map((node) => node.dataset.time) | |
.reduce((acc, time) => { | |
const [mins, secs] = time.split(":").map(parseFloat); | |
time = mins * 60 + secs; | |
return acc + time; | |
}, 0); | |
// 2️⃣ Reduce => 숫자(누적 계산 값) 반환 | |
// console.log(seconds); // 17938 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment