Skip to content

Commit 80a3ad9

Browse files
committed
fix: replace object literal with prototype-less accumulator in tally
1 parent 47367c6 commit 80a3ad9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Sprint-2/implement/tally.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function tally(arr) {
33
return arr.reduce((acc, item) => {
44
acc[item] = (acc[item] || 0) + 1;
55
return acc;
6-
}, {});
6+
}, Object.create(null));
77
}
88

99
module.exports = tally;

0 commit comments

Comments
 (0)