Skip to content

Commit 285f6a2

Browse files
committed
object creation updated
1 parent 86e8a7c commit 285f6a2

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(items) {
33
throw new Error("Input must be an array");
44
}
55

6-
const counts = {};
6+
const counts = Object.create(null);
77

88
for (const item of items) {
99
counts[item] = (counts[item] || 0) + 1;

0 commit comments

Comments
 (0)