From dcadbdc598c2bc2016c090c5a889acd89d0bc90b Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Thu, 18 May 2023 19:29:25 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jordan Harband --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3b82849..e0a533e 100644 --- a/README.md +++ b/README.md @@ -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] } @@ -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] }