Skip to content

Commit

Permalink
Merge pull request #558 from rdrgn/557-reduce-of-empty-array
Browse files Browse the repository at this point in the history
fix(frontend): pass the initial value to Array.prototype.reduceRight()
  • Loading branch information
kenkoooo committed May 17, 2020
2 parents cd2d325 + d2db3cf commit 582254a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion atcoder-problems-frontend/src/pages/UserPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ const InnerUserPage: React.FC<InnerProps> = (props) => {
ratedPointMap.set(s.problem_id, s.point);
});
const ratedPointSum = Array.from(ratedPointMap.values()).reduceRight(
(s, p) => s + p
(s, p) => s + p,
0
);

return (
Expand Down

0 comments on commit 582254a

Please sign in to comment.