Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
jridgewell and ljharb committed May 18, 2023
1 parent ae160d0 commit dcadbdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -7,7 +7,7 @@ const array = [1, 2, 3, 4, 5];

// `Object.groupBy` groups items by arbitrary key.
// In this case, we're grouping by even/odd keys
Object.groupBy(array, (num, index, array) => {
Object.groupBy(array, (num, index) => {
return num % 2 === 0 ? 'even': 'odd';
});
// => { odd: [1, 3, 5], even: [2, 4] }
Expand All @@ -16,7 +16,7 @@ Object.groupBy(array, (num, index, array) => {
// using an object key.
const odd = { odd: true };
const even = { even: true };
Map.groupBy(array, (num, index, array) => {
Map.groupBy(array, (num, index) => {
return num % 2 === 0 ? even: odd;
});
// => Map { {odd: true}: [1, 3, 5], {even: true}: [2, 4] }
Expand Down

0 comments on commit dcadbdc

Please sign in to comment.