Created
March 3, 2019 12:19
-
-
Save haru01/55ad98c73b1ba668786ce41142547b5d 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
@@ -12,9 +12,6 @@ function generateReadedReport(readedList, recommendList) { | |
function total() { | |
- let totalPoint = 0; | |
- for (let readedBook of readedList.books) { | |
- totalPoint += point(readedBook); | |
- } | |
- return totalPoint; | |
+ return readedList.books | |
+ .reduce((total, book) => total + point(book), 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment