Skip to content

Commit

Permalink
Use forEach instead of map in an array that doesn't return a result
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Jun 16, 2021
1 parent 6135b21 commit b381827
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/hooks/UseContributorStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ export function useContributorStats(contributions) {
intermediateUsers: contributions.filter((i) => i.mappingLevel === 'INTERMEDIATE').length,
advancedUsers: contributions.filter((i) => i.mappingLevel === 'ADVANCED').length,
};
[
const monthRanges = [
[0, 1],
[1, 3],
[3, 6],
[6, 12],
].map(
];
monthRanges.forEach(
(months) =>
(data[`lessThan${months[1]}MonthExp`] = contributions.filter(
(i) =>
Expand Down

0 comments on commit b381827

Please sign in to comment.