Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Transformer: grouping loops to Object.groupBy()/Map.groupBy()

Open
#215 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
69/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
tooling

Research direction

Read the existing transformer rules and tests in the repository to find how loop-based accumulator transformations are implemented. Add coverage for the shown Object accumulator and Map accumulator patterns, including Object.groupBy()'s null-prototype result. Done when the transformations are covered by passing tests.

Written by the indexing model from the issue text.

Description

widely available
// before
const byType = {};
for (const item of items) {
  const group = (byType[item.type] ??= []);
  group.push(item);
}

// after
const byType = Object.groupBy(items, (item) => item.type);

Same for Map accumulators via Map.groupBy(). Note Object.groupBy() returns a null-prototype object.

Baseline: widely available (all browsers since 2024-03-05).

Resources: MDN · spec · webstatus

Dominant language
JavaScript
Stars
15
Forks
2
Avg merge
2h 9m
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codingjoe/esupgrade

All issues in codingjoe/esupgrade

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.