Skip to content

Commit

Permalink
lodash の利用
Browse files Browse the repository at this point in the history
  • Loading branch information
jun68ykt committed Aug 9, 2019
1 parent 959003d commit f16fb40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.html
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Q204950</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js"></script>
<script src="./main.js"></script>
</head>
<body>
Expand Down
4 changes: 1 addition & 3 deletions main.js
Expand Up @@ -40,9 +40,7 @@ document.addEventListener('DOMContentLoaded', function() {
return [...map].sort((e1,e2) => e1[0].localeCompare(e2[0]));
}

const result6 = Object.entries(result5).reduce(
(obj, [k,v]) => ({...obj, [k]: summarize(v)})
, {});
const result6 = _.mapValues(result5, summarize);

console.log(result6);
}
Expand Down

0 comments on commit f16fb40

Please sign in to comment.