We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c8870b commit a12cf39Copy full SHA for a12cf39
Sprint-2/implement/tally.js
@@ -4,13 +4,13 @@ function tally(arr) {
4
}
5
const result = {};
6
for (const item of arr) {
7
- if (Object.hasOwn(result, item)) {
8
- result[item]++;
9
-} else {
10
- result[item] = 1;
11
-}
+ if (Object.hasOwn(result, item)) {
+ result[item]++;
+ } else {
+ result[item] = 1;
12
13
14
- return result;
+}
+return result;
15
16
module.exports = tally;
0 commit comments