From 885b0c2af64b6ae5d06c6cf1d54c998078fdcc31 Mon Sep 17 00:00:00 2001 From: Alexander Sokolov Date: Sat, 25 Jul 2020 11:34:21 +0300 Subject: [PATCH 1/2] Update countBy.md --- snippets/countBy.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/countBy.md b/snippets/countBy.md index 4ec176e69..31a5d2ae3 100644 --- a/snippets/countBy.md +++ b/snippets/countBy.md @@ -19,4 +19,5 @@ const countBy = (arr, fn) => ```js countBy([6.1, 4.2, 6.3], Math.floor); // {4: 1, 6: 2} countBy(['one', 'two', 'three'], 'length'); // {3: 2, 5: 1} -``` \ No newline at end of file +countBy([{ count: 5 }, { count: 10 }, { count: 5 }], item => item.count) // {5: 2, 10: 1} +``` From 199c60a0e5790b55cb29faae434e1570b0ae5acf Mon Sep 17 00:00:00 2001 From: Isabelle Viktoria Maciohsek Date: Fri, 31 Jul 2020 22:47:10 +0300 Subject: [PATCH 2/2] Update countBy.md --- snippets/countBy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/countBy.md b/snippets/countBy.md index 31a5d2ae3..2d3d1bbde 100644 --- a/snippets/countBy.md +++ b/snippets/countBy.md @@ -19,5 +19,5 @@ const countBy = (arr, fn) => ```js countBy([6.1, 4.2, 6.3], Math.floor); // {4: 1, 6: 2} countBy(['one', 'two', 'three'], 'length'); // {3: 2, 5: 1} -countBy([{ count: 5 }, { count: 10 }, { count: 5 }], item => item.count) // {5: 2, 10: 1} +countBy([{ count: 5 }, { count: 10 }, { count: 5 }], x => x.count) // {5: 2, 10: 1} ```